diff --git a/plugins/admincmd.sma b/plugins/admincmd.sma index 05ec4d70..5b83caed 100755 --- a/plugins/admincmd.sma +++ b/plugins/admincmd.sma @@ -53,18 +53,14 @@ public plugin_init(){ register_concmd("amx_slap","cmdSlap",ADMIN_SLAY," [power]") register_concmd("amx_leave","cmdLeave",ADMIN_KICK," [tag] [tag] [tag]") register_concmd("amx_pause","cmdPause",ADMIN_CVAR,"- pause or unpause the game") - register_concmd("amx_who","cmdWho",0,"- displays who is on server") - register_concmd("amx_cvar","cmdCvar",ADMIN_CVAR," [value]") + register_concmd("amx_who","cmdWho",ADMIN_ADMIN,"- displays who is on server") + register_concmd("amx_cvar","cmdCvar",ADMIN_CVAR," [value]") + register_concmd("amx_plugins","cmdPlugins",ADMIN_ADMIN) + register_concmd("amx_modules","cmdModules",ADMIN_ADMIN) register_clcmd("amx_map","cmdMap",ADMIN_MAP,"") register_clcmd("pauseAck","cmdLBack") register_clcmd("amx_cfg","cmdCfg",ADMIN_CFG,"") register_clcmd("amx_rcon","cmdRcon",ADMIN_RCON,"") - register_cvar("amx_show_activity","2") - register_cvar("amx_vote_delay","") - register_cvar("amx_vote_time","") - register_cvar("amx_vote_answers","") - register_cvar("amx_vote_ratio","") - register_cvar("amx_show_activity","") } public plugin_cfg(){ @@ -100,7 +96,16 @@ public cmdKick(id,level,cid){ case 2: client_print(0,print_chat,"ADMIN %s: kick %s",name,name2) case 1: client_print(0,print_chat,"ADMIN: kick %s",name2) } - server_cmd("kick #%d ^"%s^"",userid2,reason) + if ( is_user_bot(player) ) + server_cmd("kick #%d",userid2) + else + { +#if !defined NO_STEAM + server_cmd("kick #%d ^"%s^"",userid2,reason) +#else + client_cmd(player,"echo ^"%s^";disconnect",reason) +#endif + } console_print(id,"Client ^"%s^" kicked",name2) return PLUGIN_HANDLED } @@ -184,10 +189,22 @@ public cmdBan(id,level,cid){ if ( equal(cmd[7],"ip") || (!equal(cmd[7],"id") && get_cvar_num("sv_lan")) ){ new address[32] get_user_ip(player,address,31,1) +#if !defined NO_STEAM server_cmd("kick #%d ^"%s (banned %s)^";wait;addip ^"%s^" ^"%s^";wait;writeip",userid2,reason,temp,minutes,address) +#else + client_cmd(player,"echo ^"%s (banned %s)^";disconnect",reason,temp) + server_cmd("addip ^"%s^" ^"%s^";wait;writeip",minutes,address) +#endif } else + { +#if !defined NO_STEAM server_cmd("kick #%d ^"%s (banned %s)^";wait;banid ^"%s^" ^"%s^";wait;writeid",userid2,reason,temp,minutes,authid2) +#else + client_cmd(player,"echo ^"%s (banned %s)^";disconnect",reason,temp) + server_cmd("banid ^"%s^" ^"%s^";wait;writeip",minutes,authid2) +#endif + } new activity = get_cvar_num("amx_show_activity") if (activity) { @@ -334,13 +351,101 @@ public cmdCvar(id,level,cid){ temp = "ADMIN:" else format(temp,63,"ADMIN %s:",name) - client_print(0,print_chat,"%s set cvar %s to ^"%s^"",temp,arg,equal(arg,"rcon_password") ? "*** PROTECTED ***" : arg2) + if (equal(arg,"rcon_password") || equal(arg,"sv_password")) + copy(arg2,63,"*** PROTECTED ***") + client_print(0,print_chat,"%s set cvar %s to ^"%s^"",temp,arg,arg2) } console_print(id,"Cvar ^"%s^" changed to ^"%s^"",arg,arg2) return PLUGIN_HANDLED } +public cmdPlugins(id,level,cid) +{ + if (!cmd_access(id,level,cid,1)) + return PLUGIN_HANDLED + +#if !defined NO_STEAM + #define MOTD_LEN 1024 + new motd_body[MOTD_LEN],state[4] + new num = get_pluginsnum() + new running = 0 + new pos = copy(motd_body,MOTD_LEN,"") + + for (new i=0;i",state,name,version,author,filename,status) + if (equal(status,"running")) + running++ + } + format(motd_body[pos],MOTD_LEN-pos,"
NameVersionAuthorFilenamestatus
%s%s%s%s%s
%d plugins, %d running",num,running) + show_motd(id,motd_body,"Currently loaded plugins:") +#else + new num = get_pluginsnum() + new running = 0 + console_print(id,"Currently loaded plugins:") + console_print(id,"%-18.17s %-8.7s %-17.16s %-16.15s %-9.8s","name","version","author","file","status") + for (new i=0;i") + + for (new i=0;i",state,name,version,author) + } + format(motd_body[pos],MOTD_LEN-pos,"
NameVersionAuthor
%s%s%s
%d modules",num) + show_motd(id,motd_body,"Currently loaded modules:") +#else + new num = get_modulesnum() + console_print(id,"Currently loaded modules:") + console_print(id,"%-23.22s %-8.7s %-20.19s","name","version","author") + for (new i=0;i