Hmm...I'm not sure why, but this isn't catching the command like I want, and stopping it. Nor is it even working at all. Any help? Thanks.
Before I get rude comments about me being bad because im blocking something that may be important, just to let you know, this is really for TS, users often bind a key to time refresh when jumping a wall, and they keep hitting this button, and it allows them to keep jumping non-stop. I'd like to stop it, because it ruins rp.
Code:
//////////////////////////////////////////////
//--------------------------------------------
//-NO TIME REFRESH---Remo Williams------------
//--------------------------------------------
////////////////////////////////////////////////
#include <amxmodx>
#include <amxmisc>
new warning[1]=(0)
public plugin_init(){
register_clcmd("timerefresh","nono",1,"- Time Refresh is not allowed.")
}
public nono(id) {
if(!is_user_connected(id)) {
return PLUGIN_HANDLED
}
new name[32], authid[32]
get_user_name(id,name,31)
get_user_authid(id,authid,31)
if(warning[id] == 0) {
client_print(0,print_chat,"WARNING!!! ***Violation!!*** TimeRefresh Not Allowed. Warning 1 of 3 Issued to: %s. 3 Warnings = BAN for 1337 Minutes.",name)
client_print(0,print_chat,"STEAMID: %s, LOGGED for first warning issued!",authid)
warning[id] = 1
return PLUGIN_HANDLED
}
if(warning[id] == 1) {
client_print(0,print_chat,"WARNING!!! ***Violation!!*** TimeRefresh Not Allowed. Warning 2 of 3 Issued to: %s. 3 Warnings = BAN for 1337 Minutes.",name)
client_print(0,print_chat,"STEAMID: %s, LOGGED for second warning issued!",authid)
warning[id] = 2
return PLUGIN_HANDLED
}
if(warning[id] == 2) {
client_print(0,print_chat,"WARNING!!! ***Violation!!*** TimeRefresh Not Allowed. Warning 3 of 3 Issued to: %s. 3 Warnings = BAN for 1337 Minutes.",name)
client_print(0,print_chat,"STEAMID: %s, LOGGED for last warning issued!",authid)
client_print(0,print_chat,"Player: %s, Has Received Maximum number of warnings allowed. Consequencial Actions are being executed!",name)
server_cmd("banid 1337 '%s' kick",authid)
warning[id] = 3
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
__________________