Something like this:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>
public plugin_init() {
register_plugin("NoScopeMode","1.0","Fire")
register_clcmd("amx_scope","doScope",ADMIN_KICK,"- Turns scope mode on/off")
register_cvar("amx_noscope","1")
}
public client_PreThink(id) {
if (get_cvar_num("amx_noscope") !=1) {
return PLUGIN_CONTINUE
}
if(!is_user_alive(id)) {
return PLUGIN_CONTINUE
}
new button = get_user_button(id);
if(button & IN_ATTACK2) {
entity_set_int(id,EV_INT_button,button & ~IN_ATTACK2);
}
return PLUGIN_CONTINUE
}
public doScope(id,level,cid) {
if(!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED
new arg[4]
read_argv(1,arg,3)
new cmd = arg[3]
if(cmd == 1) {
// set_hudmessage(...)
show_hudmessage(0,"No scope mode on")
set_cvar_num("amx_noscope",1)
}
else if(cmd == 0) {
// set_hudmessage(...)
show_hudmessage(0,"No scope mode off")
set_cvar_num("amx_noscope",1)
}
return PLUGIN_HANDLED
}
Command: amx_scope <1|0>
Cvar: amx_noscope <1|0>
__________________