miało by to wyglądać mniej więcej tak, aby plugin sprawdzał co jakieś 2 minuty ile jest graczy na serwerze jeżeli wynik byłby 0 to po 3 takich akchach (razem 6 min) hasło z serwera zostało by zdjęte jakby ktoś znalazł chwilkę czasu to mógłby cos pokombinować z pluginem amx_nopass.
#include <amxmodx>
#include <amxmisc>
new PLUGIN[]="AMX PASS/NO PASS"
new AUTHOR[]="Sparky911"
new VERSION[]="1.00"
new authid[32]
new name[32]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_pass", "pass", ADMIN_BAN, "- Sets a server password")
register_concmd("amx_nopass", "nopass", ADMIN_BAN, "- Removes the server password")
}
public pass(id, level, cid)
{
if(!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
new cmd[32], password[128]
read_argv(0, cmd, 31)
read_args(password, 127)
replace(password, 127, cmd, "")
format(password, 127, "%s", password)
get_user_name(id, name, 31)
get_user_authid(id, authid, 31)
switch (get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat,"ADMIN %s has set a server password",name)
case 1: client_print(0,print_chat,"ADMIN: A server password has been set")
}
log_amx("Cmd: ^"%s<%d><%s>^" set the server password to %s",name,get_user_userid(id),authid,password)
set_cvar_string("sv_password", password)
return PLUGIN_HANDLED
}
public nopass(id, level, cid)
{
if(!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
get_user_name(id, name, 31)
get_user_authid(id, authid, 31)
switch (get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat,"ADMIN %s has removed the server password",name)
case 1: client_print(0,print_chat,"ADMIN: The server password has been removed")
}
log_amx("Cmd: ^"%s<%d><%s>^" removed server password", name,get_user_userid(id),authid)
set_cvar_string("sv_password", "")
return PLUGIN_HANDLED
}