On my server I made this plugin
Code:
#include <amxmodx>
#include <amxmisc>
public plugin_init() {
register_plugin("Hook Set", "1.0", "DataMatrix")
register_concmd("amx_hook","cmdHook",ADMIN_LEVEL_A,"0 = Disable | 1 = Enable")
}
public cmdHook(id,level,cid) {
if (!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED
new arg[32],name[32]
read_argv(id,arg,31)
get_user_name(id,name,31)
if (equal(arg,"0")==1) {
set_cvar_num("df_hook_on",0)
} else if (equal(arg,"1")==1) {
set_cvar_num("df_hook_on",1)
} else {
client_print(id,print_console,"[AMXX] Invalid arguement: %s",arg)
}
switch(get_cvar_num("amx_show_activity")) {
case 1: client_print(0,print_chat,"[AMXX] ADMIN: set hook to %s",arg)
case 2: client_print(0,print_chat,"[AMXX] ADMIN %s: set hook to %s",name,arg)
}
return PLUGIN_CONTINUE
}
Sometimes I will type in "amx_hook 1" and it will enable hook saying:
"[AMXX] ADMIN DataMatrix: set hook to 1"
Then maybe after a while I or other admins will try "amx_hook 0" or something and it will say:
"[AMXX] ADMIN DataMatrix: set hook to "
It doesn't disable or work most of the time, I've looked top to bottom and find no problems of my own.
Any help appreciated.