Code:
register_concmd("ma_hsonly","hs_only",ADMIN_KICK,"enable hs only")
register_cvar("hs_only","0");
public hs_only(id,level,cid)
{
if(!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED
new arg[12];
read_argv(1,arg,11);
if(str_to_num(arg) > 0)
{
client_print(0,print_chat,"Meta-Addons: HS ONLY MODE ENABLED FOR THIS ROUND")
set_user_hitzones(0,0,2)
}
else
{
client_print(0,print_chat,"Meta-Addons: HS ONLY MODE DISABLED FOR THIS ROUND")
// reset hitzones however you do it
}
return PLUGIN_CONTINUE
}
This uses the cmd_access function from the amxmisc include to make sure the person calling the function really has access to it. The last parameter is the number of arguments the function has plus one. Since we only want one argument, on or off, we take that and add one to get two.
It then uses the read_argv function to read the first argument (that's the first parameter, 1) into the arg variable. Then we check to see if it is more then one and turn it on, otherwise we turn it off.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS