added dod plugins
This commit is contained in:
parent
cf65ebf647
commit
78c191b4c9
26
plugins/dod/dodstats.sma
Executable file
26
plugins/dod/dodstats.sma
Executable file
@ -0,0 +1,26 @@
|
||||
/* Get Score for DoD STATS.
|
||||
*
|
||||
* (c) 2004, SidLuke
|
||||
* This file is provided as is (no warranties).
|
||||
*
|
||||
* Function calculates position in rank.
|
||||
*
|
||||
* Stats:
|
||||
* 0 - kills
|
||||
* 1 - deaths
|
||||
* 2 - headshots
|
||||
* 3 - teamkilling
|
||||
* 4 - shots
|
||||
* 5 - hits
|
||||
* 6 - damage
|
||||
* 7 - score
|
||||
*
|
||||
* File location: $moddir/addons/amx
|
||||
*/
|
||||
|
||||
#include <amxmodx>
|
||||
|
||||
public get_score(stats[9],body[8])
|
||||
{
|
||||
return stats[0] - stats[1] - stats[3] /* kills - deaths - TKs */
|
||||
}
|
201
plugins/dod/menufront.sma
Executable file
201
plugins/dod/menufront.sma
Executable file
@ -0,0 +1,201 @@
|
||||
/* AMX Mod X
|
||||
* Menus Front-End Plugin
|
||||
*
|
||||
* by the AMX Mod X Development Team
|
||||
* originally developed by OLO
|
||||
*
|
||||
* This file is part of AMX Mod X.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* In addition, as a special exception, the author gives permission to
|
||||
* link the code of this program with the Half-Life Game Engine ("HL
|
||||
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
||||
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
||||
* respects for all of the code used other than the HL Engine and MODs
|
||||
* from Valve. If you modify this file, you may extend this exception
|
||||
* to your version of the file, but you are not obligated to do so. If
|
||||
* you do not wish to do so, delete this exception statement from your
|
||||
* version.
|
||||
*/
|
||||
|
||||
#include <amxmodx>
|
||||
#include <amxmisc>
|
||||
|
||||
new g_menuPosition[33]
|
||||
|
||||
#define MENUS_NUMBER 16
|
||||
|
||||
new g_menuBody[MENUS_NUMBER][] = {
|
||||
"KICK_PLAYER",
|
||||
"BAN_PLAYER",
|
||||
"SLAP_SLAY",
|
||||
"TEAM_PLAYER",
|
||||
|
||||
"CHANGEL",
|
||||
"VOTE_MAPS",
|
||||
|
||||
"SPECH_STUFF",
|
||||
"CLIENT_COM",
|
||||
|
||||
// Next Page
|
||||
|
||||
"SERVER_COM",
|
||||
"CVARS_SET",
|
||||
"CONFIG",
|
||||
"LANG_SET",
|
||||
"STATS_SET",
|
||||
|
||||
"PAUSE_PLUG",
|
||||
"RES_WEAP",
|
||||
|
||||
"TELE_PLAYER" /* Last is Teleport menu - if you want to move it
|
||||
change also code in displayMenu (look for fun module check) */
|
||||
}
|
||||
|
||||
new g_menuCmd[MENUS_NUMBER][] = {
|
||||
"amx_kickmenu",
|
||||
"amx_banmenu",
|
||||
"amx_slapmenu",
|
||||
"amx_teammenu",
|
||||
|
||||
"amx_mapmenu",
|
||||
"amx_votemapmenu",
|
||||
|
||||
"amx_speechmenu",
|
||||
"amx_clcmdmenu",
|
||||
|
||||
// Next Page
|
||||
|
||||
"amx_cmdmenu",
|
||||
"amx_cvarmenu",
|
||||
"amx_cfgmenu",
|
||||
"amx_setlangmenu",
|
||||
"amx_statscfgmenu",
|
||||
|
||||
"amx_pausecfgmenu",
|
||||
"amx_restmenu",
|
||||
|
||||
"amx_teleportmenu"
|
||||
}
|
||||
|
||||
// Second value sets if menu is only for CS...
|
||||
new g_menuAccess[MENUS_NUMBER][2] = {
|
||||
{ADMIN_KICK,0},
|
||||
{ADMIN_BAN,0},
|
||||
{ADMIN_SLAY,0},
|
||||
{ADMIN_LEVEL_A,0},
|
||||
|
||||
{ADMIN_MAP,0},
|
||||
{ADMIN_MAP,0},
|
||||
|
||||
{ADMIN_MENU,0},
|
||||
{ADMIN_LEVEL_A,0},
|
||||
|
||||
// Next Page
|
||||
|
||||
{ADMIN_MENU,0},
|
||||
{ADMIN_CVAR,0},
|
||||
{ADMIN_MENU,0},
|
||||
{ADMIN_CFG,0},
|
||||
{ADMIN_CFG,0},
|
||||
|
||||
{ADMIN_CFG,0},
|
||||
{ADMIN_CFG,1},
|
||||
|
||||
{ADMIN_LEVEL_A,0}
|
||||
}
|
||||
|
||||
new g_coloredMenus
|
||||
new g_cstrikeRunning
|
||||
new g_funModule
|
||||
|
||||
public plugin_init() {
|
||||
register_plugin("Menus Front-End",AMXX_VERSION_STR,"AMXX Dev Team")
|
||||
|
||||
register_dictionary("menufront.txt")
|
||||
register_dictionary("common.txt")
|
||||
|
||||
register_menucmd(register_menuid("AMX Mod X Menu"),1023,"actionMenu")
|
||||
register_clcmd("amxmodmenu","cmdMenu",ADMIN_MENU,"- displays menus")
|
||||
|
||||
g_coloredMenus = colored_menus()
|
||||
g_cstrikeRunning = cstrike_running()
|
||||
g_funModule = is_module_loaded("Fun")
|
||||
}
|
||||
|
||||
public actionMenu(id,key) {
|
||||
switch (key) {
|
||||
case 8: displayMenu(id,++g_menuPosition[id])
|
||||
case 9: displayMenu(id,--g_menuPosition[id])
|
||||
default: client_cmd(id, g_menuCmd[ g_menuPosition[id] * 8 + key ] )
|
||||
}
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
displayMenu(id,pos) {
|
||||
if (pos < 0) return
|
||||
|
||||
new menuBody[512]
|
||||
new b = 0
|
||||
new start = pos * 8
|
||||
|
||||
if ( start >= MENUS_NUMBER )
|
||||
start = pos = g_menuPosition[id] = 0
|
||||
|
||||
new len = format(menuBody,511,
|
||||
g_coloredMenus ? "\yAMX Mod X Menu\R%d/%d^n\w^n" : "AMX Mod X Menu %d/%d^n^n" , pos+1, 2 )
|
||||
|
||||
new end = start + 8
|
||||
new keys = MENU_KEY_0
|
||||
|
||||
if (end > MENUS_NUMBER )
|
||||
end = MENUS_NUMBER
|
||||
|
||||
new flags = get_user_flags(id)
|
||||
|
||||
for (new a = start; a < end; ++a) {
|
||||
if ( a == MENUS_NUMBER - 1 && !g_funModule )
|
||||
continue // checks if there is fun module for teleport menu
|
||||
|
||||
if ( (flags & g_menuAccess[a][0]) && ( g_menuAccess[a][1] ? g_cstrikeRunning : 1 ) ) {
|
||||
keys |= (1<<b)
|
||||
len += format(menuBody[len],511-len,"%d. %L^n",++b, id, g_menuBody[ a ] )
|
||||
}
|
||||
else {
|
||||
++b
|
||||
if ( g_coloredMenus )
|
||||
len += format(menuBody[len],511-len, "\d%d. %L^n\w",b, id, g_menuBody[ a ] )
|
||||
else
|
||||
len += format(menuBody[len],511-len, "#. %L^n", id, g_menuBody[ a ] )
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (end != MENUS_NUMBER ) {
|
||||
format(menuBody[len],511-len,"^n9. %L...^n0. %s", id, "MORE", id, pos ? "BACK" : "EXIT")
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %s", id, pos ? "BACK" : "EXIT")
|
||||
|
||||
show_menu(id,keys,menuBody)
|
||||
}
|
||||
|
||||
public cmdMenu(id,level,cid) {
|
||||
if (cmd_access(id,level,cid,1))
|
||||
displayMenu(id,g_menuPosition[id] = 0)
|
||||
return PLUGIN_HANDLED
|
||||
}
|
667
plugins/dod/plmenu.sma
Executable file
667
plugins/dod/plmenu.sma
Executable file
@ -0,0 +1,667 @@
|
||||
/* AMX Mod X
|
||||
* Players Menu Plugin
|
||||
*
|
||||
* by the AMX Mod X Development Team
|
||||
* originally developed by OLO
|
||||
*
|
||||
* This file is part of AMX Mod X.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* In addition, as a special exception, the author gives permission to
|
||||
* link the code of this program with the Half-Life Game Engine ("HL
|
||||
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
||||
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
||||
* respects for all of the code used other than the HL Engine and MODs
|
||||
* from Valve. If you modify this file, you may extend this exception
|
||||
* to your version of the file, but you are not obligated to do so. If
|
||||
* you do not wish to do so, delete this exception statement from your
|
||||
* version.
|
||||
*/
|
||||
|
||||
#include <amxmodx>
|
||||
#include <amxmisc>
|
||||
#include <dodx>
|
||||
|
||||
new g_menuPosition[33]
|
||||
new g_menuPlayers[33][32]
|
||||
new g_menuPlayersNum[33]
|
||||
new g_menuOption[33]
|
||||
new g_menuSettings[33]
|
||||
|
||||
new g_menuSelect[33][64]
|
||||
new g_menuSelectNum[33]
|
||||
|
||||
#define MAX_CLCMDS 24
|
||||
|
||||
new g_clcmdName[MAX_CLCMDS][32]
|
||||
new g_clcmdCmd[MAX_CLCMDS][64]
|
||||
new g_clcmdMisc[MAX_CLCMDS][2]
|
||||
new g_clcmdNum
|
||||
|
||||
new g_coloredMenus
|
||||
|
||||
public plugin_init() {
|
||||
register_plugin("Players Menu",AMXX_VERSION_STR,"AMXX Dev Team")
|
||||
|
||||
register_dictionary("plmenu.txt")
|
||||
register_dictionary("common.txt")
|
||||
|
||||
register_clcmd("amx_kickmenu","cmdKickMenu",ADMIN_KICK,"- displays kick menu")
|
||||
register_clcmd("amx_banmenu","cmdBanMenu",ADMIN_BAN,"- displays ban menu")
|
||||
register_clcmd("amx_slapmenu","cmdSlapMenu",ADMIN_SLAY,"- displays slap/slay menu")
|
||||
register_clcmd("amx_teammenu","cmdTeamMenu",ADMIN_LEVEL_A,"- displays team menu")
|
||||
register_clcmd("amx_clcmdmenu","cmdClcmdMenu",ADMIN_LEVEL_A,"- displays client cmds menu")
|
||||
|
||||
register_menucmd(register_menuid("Ban Menu"),1023,"actionBanMenu")
|
||||
register_menucmd(register_menuid("Kick Menu"),1023,"actionKickMenu")
|
||||
register_menucmd(register_menuid("Slap/Slay Menu"),1023,"actionSlapMenu")
|
||||
register_menucmd(register_menuid("Team Menu"),1023,"actionTeamMenu")
|
||||
register_menucmd(register_menuid("Client Cmds Menu"),1023,"actionClcmdMenu")
|
||||
|
||||
g_coloredMenus = colored_menus()
|
||||
|
||||
new clcmds_ini_file[64]
|
||||
get_configsdir(clcmds_ini_file, 63)
|
||||
format(clcmds_ini_file, 63, "%s/clcmds.ini", clcmds_ini_file)
|
||||
load_settings(clcmds_ini_file)
|
||||
}
|
||||
|
||||
/* Ban menu */
|
||||
|
||||
public actionBanMenu(id,key) {
|
||||
switch (key) {
|
||||
case 7: {
|
||||
++g_menuOption[id]
|
||||
g_menuOption[id] %= 3
|
||||
|
||||
switch(g_menuOption[id]){
|
||||
case 0: g_menuSettings[id] = 0
|
||||
case 1: g_menuSettings[id] = 5
|
||||
case 2: g_menuSettings[id] = 60
|
||||
}
|
||||
|
||||
displayBanMenu(id,g_menuPosition[id])
|
||||
}
|
||||
case 8: displayBanMenu(id,++g_menuPosition[id])
|
||||
case 9: displayBanMenu(id,--g_menuPosition[id])
|
||||
default: {
|
||||
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
|
||||
|
||||
new name[32], name2[32], authid[32],authid2[32]
|
||||
get_user_name(player,name2,31)
|
||||
get_user_authid(id,authid,31)
|
||||
get_user_authid(player,authid2,31)
|
||||
get_user_name(id,name,31)
|
||||
new userid2 = get_user_userid(player)
|
||||
|
||||
log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%d^")",
|
||||
name,get_user_userid(id),authid, name2,userid2,authid2, g_menuSettings[id] )
|
||||
|
||||
switch (get_cvar_num("amx_show_activity")) {
|
||||
case 2: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_BAN_2",name,name2)
|
||||
case 1: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_BAN_1",name2)
|
||||
}
|
||||
|
||||
if (equal("4294967295",authid2)) { /* lan */
|
||||
new ipa[32]
|
||||
get_user_ip(player,ipa,31,1)
|
||||
server_cmd("addip %d %s;writeip",g_menuSettings[id],ipa)
|
||||
}
|
||||
else
|
||||
server_cmd("banid %d #%d kick;writeid",g_menuSettings[id],userid2)
|
||||
|
||||
server_exec()
|
||||
|
||||
displayBanMenu(id,g_menuPosition[id])
|
||||
}
|
||||
}
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
displayBanMenu(id,pos) {
|
||||
if (pos < 0) return
|
||||
|
||||
get_players(g_menuPlayers[id],g_menuPlayersNum[id])
|
||||
|
||||
new menuBody[512]
|
||||
new b = 0
|
||||
new i
|
||||
new name[32]
|
||||
new start = pos * 7
|
||||
|
||||
if (start >= g_menuPlayersNum[id])
|
||||
start = pos = g_menuPosition[id] = 0
|
||||
|
||||
new len = format(menuBody,511, g_coloredMenus ?
|
||||
"\y%L\R%d/%d^n\w^n" : "%L %d/%d^n^n",
|
||||
id,"BAN_MENU",pos+1,( g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0 )) )
|
||||
|
||||
new end = start + 7
|
||||
new keys = MENU_KEY_0|MENU_KEY_8
|
||||
|
||||
if (end > g_menuPlayersNum[id])
|
||||
end = g_menuPlayersNum[id]
|
||||
|
||||
for (new a = start; a < end; ++a) {
|
||||
i = g_menuPlayers[id][a]
|
||||
get_user_name(i,name,31)
|
||||
|
||||
if ( is_user_bot(i) || access(i,ADMIN_IMMUNITY) ) {
|
||||
++b
|
||||
if ( g_coloredMenus )
|
||||
len += format(menuBody[len],511-len,"\d%d. %s^n\w",b,name)
|
||||
else
|
||||
len += format(menuBody[len],511-len,"#. %s^n",name)
|
||||
}
|
||||
else {
|
||||
keys |= (1<<b)
|
||||
len += format(menuBody[len],511-len,"%d. %s^n",++b,name)
|
||||
}
|
||||
}
|
||||
|
||||
if ( g_menuSettings[id] )
|
||||
len += format(menuBody[len],511-len,"^n8. %L^n", id, "BAN_FOR_MIN", g_menuSettings[id] )
|
||||
else
|
||||
len += format(menuBody[len],511-len,"^n8. %L^n", id, "BAN_PERM" )
|
||||
|
||||
if (end != g_menuPlayersNum[id]) {
|
||||
format(menuBody[len],511-len,"^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %L", id, pos ? "BACK" : "EXIT")
|
||||
|
||||
show_menu(id,keys,menuBody,-1,"Ban Menu")
|
||||
}
|
||||
|
||||
public cmdBanMenu(id,level,cid) {
|
||||
if (!cmd_access(id,level,cid,1))
|
||||
return PLUGIN_HANDLED
|
||||
|
||||
g_menuOption[id] = 1
|
||||
g_menuSettings[id] = 5
|
||||
displayBanMenu(id,g_menuPosition[id] = 0)
|
||||
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
/* Slap/Slay */
|
||||
|
||||
public actionSlapMenu(id,key) {
|
||||
switch (key) {
|
||||
case 7: {
|
||||
++g_menuOption[id]
|
||||
g_menuOption[id] %= 4
|
||||
switch (g_menuOption[id]) {
|
||||
case 1: g_menuSettings[id] = 0
|
||||
case 2: g_menuSettings[id] = 1
|
||||
case 3: g_menuSettings[id] = 5
|
||||
}
|
||||
displaySlapMenu(id,g_menuPosition[id])
|
||||
}
|
||||
case 8: displaySlapMenu(id,++g_menuPosition[id])
|
||||
case 9: displaySlapMenu(id,--g_menuPosition[id])
|
||||
default: {
|
||||
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
|
||||
|
||||
new name2[32]
|
||||
get_user_name(player,name2,31)
|
||||
|
||||
if (!is_user_alive(player)) {
|
||||
client_print(id,print_chat,"%L",id,"CANT_PERF_DEAD",name2)
|
||||
displaySlapMenu(id,g_menuPosition[id])
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
new authid[32],authid2[32], name[32]
|
||||
|
||||
get_user_authid(id,authid,31)
|
||||
get_user_authid(player,authid2,31)
|
||||
get_user_name(id,name,31)
|
||||
|
||||
if ( g_menuOption[id] ) {
|
||||
log_amx("Cmd: ^"%s<%d><%s><>^" slap with %d damage ^"%s<%d><%s><>^"",
|
||||
name,get_user_userid(id),authid, g_menuSettings[id], name2,get_user_userid(player),authid2 )
|
||||
switch (get_cvar_num("amx_show_activity")) {
|
||||
case 2: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_SLAP_2",name,name2,g_menuSettings[id])
|
||||
case 1: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_SLAP_1",name2,g_menuSettings[id])
|
||||
}
|
||||
}
|
||||
else {
|
||||
log_amx("Cmd: ^"%s<%d><%s><>^" slay ^"%s<%d><%s><>^"",
|
||||
name,get_user_userid(id),authid, name2,get_user_userid(player),authid2 )
|
||||
switch(get_cvar_num("amx_show_activity")) {
|
||||
case 2: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_SLAY_2",name,name2)
|
||||
case 1: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_SLAY_1",name2)
|
||||
}
|
||||
}
|
||||
|
||||
if ( g_menuOption[id])
|
||||
user_slap(player, ( get_user_health(player) > g_menuSettings[id] ) ? g_menuSettings[id] : 0 )
|
||||
else
|
||||
user_kill( player )
|
||||
|
||||
displaySlapMenu(id,g_menuPosition[id])
|
||||
}
|
||||
}
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
|
||||
displaySlapMenu(id,pos) {
|
||||
if (pos < 0) return
|
||||
|
||||
get_players(g_menuPlayers[id],g_menuPlayersNum[id])
|
||||
|
||||
new menuBody[512]
|
||||
new b = 0
|
||||
new i
|
||||
new name[32], team[8]
|
||||
new start = pos * 7
|
||||
|
||||
if (start >= g_menuPlayersNum[id])
|
||||
start = pos = g_menuPosition[id] = 0
|
||||
|
||||
new len = format(menuBody,511, g_coloredMenus ?
|
||||
"\y%L\R%d/%d^n\w^n" : "%L %d/%d^n^n",
|
||||
id,"SLAP_SLAY_MENU",pos+1,( g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0 )) )
|
||||
|
||||
new end = start + 7
|
||||
new keys = MENU_KEY_0|MENU_KEY_8
|
||||
|
||||
if (end > g_menuPlayersNum[id])
|
||||
end = g_menuPlayersNum[id]
|
||||
|
||||
for (new a = start; a < end; ++a) {
|
||||
i = g_menuPlayers[id][a]
|
||||
get_user_name(i,name,31)
|
||||
get_user_team(i,team,7)
|
||||
|
||||
if ( !is_user_alive(i) || access(i,ADMIN_IMMUNITY) ) {
|
||||
++b
|
||||
if ( g_coloredMenus )
|
||||
len += format(menuBody[len],511-len,"\d%d. %s\R%s^n\w", b,name,team)
|
||||
else
|
||||
len += format(menuBody[len],511-len,"#. %s %s^n",name,team)
|
||||
}
|
||||
else
|
||||
{
|
||||
keys |= (1<<b)
|
||||
|
||||
len += format(menuBody[len],511-len, g_coloredMenus ?
|
||||
"%d. %s\y\R%s^n\w" : "%d. %s %s^n",++b,name,team)
|
||||
}
|
||||
}
|
||||
|
||||
if ( g_menuOption[id] )
|
||||
len += format(menuBody[len],511-len,"^n8. %L^n",id,"SLAP_WITH_DMG",g_menuSettings[id] )
|
||||
else
|
||||
len += format(menuBody[len],511-len,"^n8. %L^n",id,"SLAY")
|
||||
|
||||
if (end != g_menuPlayersNum[id]) {
|
||||
format(menuBody[len],511-len,"^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %L", id, pos ? "BACK" : "EXIT")
|
||||
|
||||
show_menu(id,keys,menuBody,-1,"Slap/Slay Menu")
|
||||
}
|
||||
|
||||
public cmdSlapMenu(id,level,cid)
|
||||
{
|
||||
if (!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED
|
||||
|
||||
g_menuOption[id] = 0
|
||||
g_menuSettings[id] = 0
|
||||
|
||||
displaySlapMenu(id,g_menuPosition[id] = 0)
|
||||
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
/* Kick */
|
||||
|
||||
public actionKickMenu(id,key)
|
||||
{
|
||||
switch (key) {
|
||||
case 8: displayKickMenu(id,++g_menuPosition[id])
|
||||
case 9: displayKickMenu(id,--g_menuPosition[id])
|
||||
default: {
|
||||
new player = g_menuPlayers[id][g_menuPosition[id] * 8 + key]
|
||||
|
||||
new authid[32],authid2[32], name[32], name2[32]
|
||||
get_user_authid(id,authid,31)
|
||||
get_user_authid(player,authid2,31)
|
||||
get_user_name(id,name,31)
|
||||
get_user_name(player,name2,31)
|
||||
new userid2 = get_user_userid(player)
|
||||
|
||||
log_amx("Kick: ^"%s<%d><%s><>^" kick ^"%s<%d><%s><>^"",
|
||||
name,get_user_userid(id),authid, name2,userid2,authid2 )
|
||||
|
||||
switch (get_cvar_num("amx_show_activity")) {
|
||||
case 2: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_KICK_2",name,name2)
|
||||
case 1: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_KICK_1",name2)
|
||||
}
|
||||
|
||||
server_cmd("kick #%d",userid2)
|
||||
server_exec()
|
||||
|
||||
displayKickMenu(id,g_menuPosition[id])
|
||||
}
|
||||
}
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
displayKickMenu(id,pos) {
|
||||
if (pos < 0) return
|
||||
|
||||
get_players(g_menuPlayers[id],g_menuPlayersNum[id])
|
||||
|
||||
new menuBody[512]
|
||||
new b = 0
|
||||
new i
|
||||
new name[32]
|
||||
new start = pos * 8
|
||||
|
||||
if (start >= g_menuPlayersNum[id])
|
||||
start = pos = g_menuPosition[id] = 0
|
||||
|
||||
new len = format(menuBody,511, g_coloredMenus ?
|
||||
"\y%L\R%d/%d^n\w^n" : "%L %d/%d^n^n",
|
||||
id,"KICK_MENU",pos+1,( g_menuPlayersNum[id] / 8 + ((g_menuPlayersNum[id] % 8) ? 1 : 0 )) )
|
||||
|
||||
new end = start + 8
|
||||
new keys = MENU_KEY_0
|
||||
|
||||
if (end > g_menuPlayersNum[id])
|
||||
end = g_menuPlayersNum[id]
|
||||
|
||||
for (new a = start; a < end; ++a) {
|
||||
i = g_menuPlayers[id][a]
|
||||
get_user_name(i,name,31)
|
||||
|
||||
if ( access(i,ADMIN_IMMUNITY) ) {
|
||||
++b
|
||||
if ( g_coloredMenus )
|
||||
len += format(menuBody[len],511-len,"\d%d. %s^n\w",b,name)
|
||||
else
|
||||
len += format(menuBody[len],511-len,"#. %s^n",name)
|
||||
|
||||
}
|
||||
else {
|
||||
keys |= (1<<b)
|
||||
len += format(menuBody[len],511-len,"%d. %s^n",++b,name)
|
||||
}
|
||||
}
|
||||
|
||||
if (end != g_menuPlayersNum[id]) {
|
||||
format(menuBody[len],511-len,"^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %L", id, pos ? "BACK" : "EXIT")
|
||||
|
||||
show_menu(id,keys,menuBody,-1,"Kick Menu")
|
||||
}
|
||||
|
||||
public cmdKickMenu(id,level,cid) {
|
||||
if (cmd_access(id,level,cid,1))
|
||||
displayKickMenu(id,g_menuPosition[id] = 0)
|
||||
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
/* Team menu */
|
||||
|
||||
public actionTeamMenu(id,key) {
|
||||
switch (key) {
|
||||
case 7:{
|
||||
g_menuOption[id] = 1 - g_menuOption[id]
|
||||
displayTeamMenu(id,g_menuPosition[id])
|
||||
}
|
||||
case 8: displayTeamMenu(id,++g_menuPosition[id])
|
||||
case 9: displayTeamMenu(id,--g_menuPosition[id])
|
||||
default: {
|
||||
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
|
||||
new authid[32],authid2[32], name[32], name2[32]
|
||||
get_user_name(player,name2,31)
|
||||
get_user_authid(id,authid,31)
|
||||
get_user_authid(player,authid2,31)
|
||||
get_user_name(id,name,31)
|
||||
|
||||
log_amx("Cmd: ^"%s<%d><%s><>^" transfer ^"%s<%d><%s><>^" (team ^"%s^")",
|
||||
name,get_user_userid(id),authid, name2,get_user_userid(player),authid2, g_menuOption[id] ? "Allies" : "Axis" )
|
||||
|
||||
switch (get_cvar_num("amx_show_activity")) {
|
||||
case 2: client_print(0,print_chat,"%L",id,"ADMIN_TRANSF_2",name,name2,g_menuOption[id] ? "Allies" : "Axis" )
|
||||
case 1: client_print(0,print_chat,"%L",id,"ADMIN_TRANSF_1",name2,g_menuOption[id] ? "Allies" : "Axis" )
|
||||
}
|
||||
|
||||
dod_user_kill(player)
|
||||
engclient_cmd(player,"jointeam", g_menuOption[id] ? "1" : "2" )
|
||||
|
||||
displayTeamMenu(id,g_menuPosition[id])
|
||||
}
|
||||
}
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
displayTeamMenu(id,pos) {
|
||||
if (pos < 0) return
|
||||
|
||||
get_players(g_menuPlayers[id],g_menuPlayersNum[id])
|
||||
|
||||
new menuBody[512]
|
||||
new b = 0
|
||||
new i, iteam
|
||||
new name[32], team[8]
|
||||
new start = pos * 7
|
||||
|
||||
if (start >= g_menuPlayersNum[id])
|
||||
start = pos = g_menuPosition[id] = 0
|
||||
|
||||
new len = format(menuBody,511, g_coloredMenus ?
|
||||
"\y%L\R%d/%d^n\w^n" : "%L %d/%d^n^n",
|
||||
id,"TEAM_MENU",pos+1,( g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0 )) )
|
||||
|
||||
new end = start + 7
|
||||
new keys = MENU_KEY_0|MENU_KEY_8
|
||||
|
||||
if (end > g_menuPlayersNum[id])
|
||||
end = g_menuPlayersNum[id]
|
||||
|
||||
for (new a = start; a < end; ++a) {
|
||||
i = g_menuPlayers[id][a]
|
||||
get_user_name(i,name,31)
|
||||
iteam = get_user_team(i,team,7)
|
||||
|
||||
if ( (iteam == (g_menuOption[id] ? 1 : 2)) || access(i,ADMIN_IMMUNITY) ) {
|
||||
++b
|
||||
if ( g_coloredMenus )
|
||||
len += format(menuBody[len],511-len,"\d%d. %s\R%s^n\w",b,name,team)
|
||||
else
|
||||
len += format(menuBody[len],511-len,"#. %s %s^n",name,team)
|
||||
}
|
||||
else {
|
||||
keys |= (1<<b)
|
||||
len += format(menuBody[len],511-len, g_coloredMenus ?
|
||||
"%d. %s\y\R%s^n\w" : "%d. %s %s^n",++b,name,team)
|
||||
}
|
||||
}
|
||||
|
||||
len += format(menuBody[len],511-len,"^n8. %L^n",id,"TRANSF_TO",g_menuOption[id] ? "Allies" : "Axis" )
|
||||
|
||||
if (end != g_menuPlayersNum[id])
|
||||
{
|
||||
format(menuBody[len],511-len,"^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %L", id, pos ? "BACK" : "EXIT")
|
||||
|
||||
show_menu(id,keys,menuBody,-1,"Team Menu")
|
||||
}
|
||||
|
||||
public cmdTeamMenu(id,level,cid) {
|
||||
if (!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED
|
||||
|
||||
g_menuOption[id] = 0
|
||||
|
||||
displayTeamMenu(id,g_menuPosition[id] = 0)
|
||||
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
/* Client cmds menu */
|
||||
|
||||
public actionClcmdMenu(id,key) {
|
||||
switch (key) {
|
||||
case 7:{
|
||||
++g_menuOption[id]
|
||||
g_menuOption[id] %= g_menuSelectNum[id]
|
||||
displayClcmdMenu(id,g_menuPosition[id])
|
||||
}
|
||||
case 8: displayClcmdMenu(id,++g_menuPosition[id])
|
||||
case 9: displayClcmdMenu(id,--g_menuPosition[id])
|
||||
default: {
|
||||
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
|
||||
new flags = g_clcmdMisc[g_menuSelect[id][g_menuOption[id]]][1]
|
||||
if (is_user_connected(player)) {
|
||||
new command[64], authid[32], name[32], userid[32]
|
||||
copy(command,63,g_clcmdCmd[g_menuSelect[id][g_menuOption[id]]])
|
||||
get_user_authid(player,authid,31)
|
||||
get_user_name(player,name,31)
|
||||
num_to_str(get_user_userid(player),userid,31)
|
||||
replace(command,63,"%userid%",userid)
|
||||
replace(command,63,"%authid%",authid)
|
||||
replace(command,63,"%name%",name)
|
||||
if (flags & 1) {
|
||||
server_cmd(command)
|
||||
server_exec()
|
||||
}
|
||||
else if (flags & 2)
|
||||
client_cmd(id,command)
|
||||
else if (flags & 4)
|
||||
client_cmd(player,command)
|
||||
}
|
||||
if (flags & 8) displayClcmdMenu(id,g_menuPosition[id])
|
||||
}
|
||||
}
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
displayClcmdMenu(id,pos) {
|
||||
if (pos < 0) return
|
||||
|
||||
get_players(g_menuPlayers[id],g_menuPlayersNum[id])
|
||||
|
||||
new menuBody[512]
|
||||
new b = 0
|
||||
new i
|
||||
new name[32]
|
||||
new start = pos * 7
|
||||
|
||||
if (start >= g_menuPlayersNum[id])
|
||||
start = pos = g_menuPosition[id] = 0
|
||||
|
||||
new len = format(menuBody,511, g_coloredMenus ?
|
||||
"\y%L\R%d/%d^n\w^n" : "%L %d/%d^n^n",
|
||||
id, "CL_CMD_MENU", pos+1,( g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0 )) )
|
||||
|
||||
new end = start + 7
|
||||
new keys = MENU_KEY_0|MENU_KEY_8
|
||||
|
||||
if (end > g_menuPlayersNum[id])
|
||||
end = g_menuPlayersNum[id]
|
||||
|
||||
for (new a = start; a < end; ++a) {
|
||||
i = g_menuPlayers[id][a]
|
||||
get_user_name(i,name,31)
|
||||
|
||||
if ( !g_menuSelectNum[id] || access(i,ADMIN_IMMUNITY) ) {
|
||||
++b
|
||||
if ( g_coloredMenus )
|
||||
len += format(menuBody[len],511-len,"\d%d. %s^n\w",b,name)
|
||||
else
|
||||
len += format(menuBody[len],511-len,"#. %s^n",name)
|
||||
}
|
||||
else {
|
||||
keys |= (1<<b)
|
||||
len += format(menuBody[len],511-len,"%d. %s^n",++b,name)
|
||||
}
|
||||
}
|
||||
|
||||
if ( g_menuSelectNum[id] )
|
||||
len += format(menuBody[len],511-len,"^n8. %s^n", g_clcmdName[g_menuSelect[id][g_menuOption[id]]] )
|
||||
else
|
||||
len += format(menuBody[len],511-len,"^n8. %L^n",id,"NO_CMDS")
|
||||
|
||||
if (end != g_menuPlayersNum[id]) {
|
||||
format(menuBody[len],511-len,"^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %L", id, pos ? "BACK" : "EXIT")
|
||||
|
||||
show_menu(id,keys,menuBody,-1,"Client Cmds Menu")
|
||||
}
|
||||
|
||||
public cmdClcmdMenu(id,level,cid) {
|
||||
if (!cmd_access(id,level,cid,1))
|
||||
return PLUGIN_HANDLED
|
||||
|
||||
new flags = get_user_flags(id)
|
||||
|
||||
g_menuSelectNum[id] = 0
|
||||
|
||||
for (new a = 0; a < g_clcmdNum; ++a)
|
||||
if (g_clcmdMisc[a][0] & flags)
|
||||
g_menuSelect[id][g_menuSelectNum[id]++] = a
|
||||
|
||||
g_menuOption[id] = 0
|
||||
|
||||
displayClcmdMenu(id,g_menuPosition[id] = 0)
|
||||
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
load_settings( szFilename[] ) {
|
||||
if ( !file_exists ( szFilename ) )
|
||||
return 0
|
||||
|
||||
new text[256], szFlags[32], szAccess[32]
|
||||
new a, pos = 0
|
||||
|
||||
while ( g_clcmdNum < MAX_CLCMDS && read_file (szFilename,pos++,text,255,a) ) {
|
||||
if ( text[0] == ';' ) continue
|
||||
|
||||
if ( parse( text , g_clcmdName[g_clcmdNum] , 31 ,
|
||||
g_clcmdCmd[g_clcmdNum] ,63,szFlags,31,szAccess,31 ) > 3 )
|
||||
{
|
||||
while ( replace( g_clcmdCmd[ g_clcmdNum ] ,63,"\'","^"") ) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
g_clcmdMisc[ g_clcmdNum ][1] = read_flags ( szFlags )
|
||||
g_clcmdMisc[ g_clcmdNum ][0] = read_flags ( szAccess )
|
||||
g_clcmdNum++
|
||||
}
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
public plugin_modules()
|
||||
{
|
||||
require_module("dodx")
|
||||
}
|
42
plugins/dod/plugins.ini
Executable file
42
plugins/dod/plugins.ini
Executable file
@ -0,0 +1,42 @@
|
||||
; AMX Mod X plugins
|
||||
|
||||
; Admin Base - Always one has to be activated
|
||||
admin.amxx ; admin base (required for any admin-related)
|
||||
;admin_sql.amxx ; admin base - SQL version (comment admin.amxx)
|
||||
|
||||
; Basic
|
||||
admincmd.amxx ; basic admin console commands
|
||||
adminhelp.amxx ; help command for admin console commands
|
||||
adminslots.amxx ; slot reservation
|
||||
multilingual.amxx ; Multi-Lingual management
|
||||
|
||||
; Menus
|
||||
menufront.amxx ; front-end for admin menus
|
||||
cmdmenu.amxx ; command menu (speech, settings)
|
||||
plmenu.amxx ; players menu (kick, ban, client cmds.)
|
||||
;telemenu.amxx ; teleport menu (Fun Module required!)
|
||||
mapsmenu.amxx ; maps menu (vote, changelevel)
|
||||
|
||||
; Chat / Messages
|
||||
adminchat.amxx ; console chat commands
|
||||
;antiflood.amxx ; prevent clients from chat-flooding the server
|
||||
scrollmsg.amxx ; displays a scrolling message
|
||||
imessage.amxx ; displays information messages
|
||||
adminvote.amxx ; vote commands
|
||||
|
||||
; Map related
|
||||
nextmap.amxx ; displays next map in mapcycle
|
||||
mapchooser.amxx ; allows to vote for next map
|
||||
timeleft.amxx ; displays time left on map
|
||||
|
||||
; Configuration
|
||||
pausecfg.amxx ; allows to pause and unpause some plugins
|
||||
statscfg.amxx ; allows to manage stats plugins via menu and commands
|
||||
|
||||
; DOD X Stats Plugins
|
||||
statscfg.amx ; allows to manage stats plugins via menu and commands
|
||||
stats.amx ; stats on death or round end (DoD X Module required!)
|
||||
;statssounds.amx ; precache plugin for stats plugins
|
||||
;stats_logging.amx ; weapons stats logging (DoD X Module required!)
|
||||
|
||||
; Custom - Add 3rd party plugins here
|
1055
plugins/dod/stats.sma
Executable file
1055
plugins/dod/stats.sma
Executable file
File diff suppressed because it is too large
Load Diff
66
plugins/dod/stats_logging.sma
Executable file
66
plugins/dod/stats_logging.sma
Executable file
@ -0,0 +1,66 @@
|
||||
/* AMX Mod script. (Feb 4th, 2003)
|
||||
*
|
||||
* Stats Logging
|
||||
* by JustinHoMi
|
||||
*
|
||||
*/
|
||||
|
||||
#include <amxmodx>
|
||||
#include <dodx>
|
||||
|
||||
new g_pingSum[33]
|
||||
new g_pingCount[33]
|
||||
|
||||
public plugin_init()
|
||||
register_plugin("Stats Logging","0.20dod","AMXX Dev Team")
|
||||
|
||||
public client_disconnect(id) {
|
||||
if ( is_user_bot( id ) || !isDSMActive() ) return PLUGIN_CONTINUE
|
||||
remove_task( id )
|
||||
new szTeam[16],szName[32],szAuthid[32], iStats[9], iHits[8], szWeapon[16]
|
||||
new iUserid = get_user_userid( id )
|
||||
get_user_info(id,"team", szTeam, 15 )
|
||||
szTeam[0] -= 32;
|
||||
get_user_name(id, szName ,31 )
|
||||
get_user_authid(id, szAuthid , 31 )
|
||||
for(new i = 1 ; i < DODMAX_WEAPONS; ++i ) {
|
||||
if( get_user_wstats( id , i ,iStats , iHits ) ) {
|
||||
xmod_get_wpnlogname( i , szWeapon , 15 )
|
||||
log_message("^"%s<%d><%s><%s>^" triggered ^"weaponstats^" (weapon ^"%s^") (shots ^"%d^") (hits ^"%d^") (kills ^"%d^") (headshots ^"%d^") (tks ^"%d^") (damage ^"%d^") (deaths ^"%d^") (score ^"%d^")",
|
||||
szName,iUserid,szAuthid,szTeam,szWeapon,iStats[4],iStats[5],iStats[0], iStats[2],iStats[3],iStats[6],iStats[1],iStats[7])
|
||||
log_message("^"%s<%d><%s><%s>^" triggered ^"weaponstats2^" (weapon ^"%s^") (head ^"%d^") (chest ^"%d^") (stomach ^"%d^") (leftarm ^"%d^") (rightarm ^"%d^") (leftleg ^"%d^") (rightleg ^"%d^")",
|
||||
szName,iUserid,szAuthid,szTeam,szWeapon,iHits[1],iHits[2],iHits[3], iHits[4],iHits[5],iHits[6],iHits[7])
|
||||
}
|
||||
}
|
||||
new iTime = get_user_time( id , 1 )
|
||||
log_message("^"%s<%d><%s><%s>^" triggered ^"time^" (time ^"%d:%02d^")",
|
||||
szName,iUserid,szAuthid,szTeam, (iTime / 60), (iTime % 60) )
|
||||
log_message("^"%s<%d><%s><%s>^" triggered ^"latency^" (ping ^"%d^")",
|
||||
szName,iUserid,szAuthid,szTeam, (g_pingSum[id] / ( g_pingCount[id] ? g_pingCount[id] : 1 ) ) )
|
||||
return PLUGIN_CONTINUE
|
||||
}
|
||||
|
||||
public client_putinserver(id) {
|
||||
if ( !is_user_bot( id ) ){
|
||||
g_pingSum[ id ] = g_pingCount[ id ] = 0
|
||||
set_task( 19.5 , "getPing" , id , "" , 0 , "b" )
|
||||
}
|
||||
}
|
||||
|
||||
public getPing( id ) {
|
||||
new iPing, iLoss
|
||||
get_user_ping( id , iPing, iLoss)
|
||||
g_pingSum[ id ] += iPing
|
||||
++g_pingCount[ id ]
|
||||
}
|
||||
|
||||
isDSMActive(){
|
||||
if ( get_cvar_num("dodstats_pause") )
|
||||
return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
public plugin_modules()
|
||||
{
|
||||
require_module("dodx")
|
||||
}
|
29
plugins/dod/statssounds.sma
Executable file
29
plugins/dod/statssounds.sma
Executable file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Plugin for sounds precache
|
||||
*/
|
||||
|
||||
#include <amxmodx>
|
||||
|
||||
public plugin_precache(){
|
||||
precache_sound( "misc/impressive.wav")
|
||||
precache_sound( "misc/headshot.wav")
|
||||
precache_sound( "misc/multikill.wav")
|
||||
precache_sound( "misc/doublekill.wav")
|
||||
precache_sound( "misc/godlike.wav")
|
||||
precache_sound( "misc/ultrakill.wav")
|
||||
precache_sound( "misc/killingspree.wav")
|
||||
precache_sound( "misc/rampage.wav")
|
||||
precache_sound( "misc/unstoppable.wav")
|
||||
precache_sound( "misc/monsterkill.wav")
|
||||
precache_sound( "misc/humiliation.wav")
|
||||
|
||||
precache_sound( "misc/takenlead.wav" )
|
||||
precache_sound( "misc/tiedlead.wav" )
|
||||
precache_sound( "misc/lostlead.wav" )
|
||||
|
||||
return PLUGIN_CONTINUE
|
||||
}
|
||||
|
||||
public plugin_init() {
|
||||
register_plugin("DoD Sounds Precache","0.20dod","SidLuke")
|
||||
}
|
Loading…
Reference in New Issue
Block a user