Code:
#include <amxmodx>
#include <amxmisc>
public plugin_init()
{
register_plugin("Nonoobguns", "1.4", "Allenwr")
register_concmd("amx_nng", "check_noobguns", ADMIN_ADMIN, "[0|1]")
register_cvar("amx_nonoobguns", "1")
}
public check_noobguns(id, level, cid) {
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
if (read_argc() == 1) { // if no arguments supplied we show current plugin's state
console_print(id, "^"amx_nng^" is ^"%d^"", get_cvar_num("amx_nonoobguns") ? 1 : 0)
return PLUGIN_HANDLED
}
// if argument specified we set new plugin's state (1 is on, 0 is off)
new arg[2]
read_argv(1, arg, 1)
set_cvar_num("amx_nonoobguns", str_to_num(arg) ? 1 : 0)
return PLUGIN_HANDLED
}