 |
|
Veteran Member
Join Date: Sep 2009
Location: New Jersey
|

08-30-2015
, 03:20
Re: Admin only command- Gatling weapon
|
#2
|
You should check access inside declared function.
Check source code of default plugins. For example:
Quote:
register_clcmd("amx_rcon", "cmdRcon", ADMIN_RCON, "<command line>")
public cmdRcon(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
new arg[128], authid[32], name[MAX_NAME_LENGTH]
read_args(arg, charsmax(arg))
get_user_authid(id, authid, charsmax(authid))
get_user_name(id, name, charsmax(name))
log_amx("Cmd: ^"%s<%d><%s><>^" server console (cmdline ^"%s^")", name, get_user_userid(id), authid, arg)
console_print(id, "[AMXX] %L", id, "COM_SENT_SERVER", arg)
server_cmd("%s", arg)
return PLUGIN_HANDLED
}
|
Last edited by Phant; 08-30-2015 at 03:21.
|
|
|
|