Quote:
1) Which way is better?
PHP Code:
register_clcmd("say /command","sayCommand")
or
PHP Code:
register_clcmd("say","hook_say_and_search")
|
First, because you dont need to read any arguments.
Quote:
2) Why amxmodx default plugins check users access level twice?
in register_clcmd
i.e
PHP Code:
register_clcmd("say /command","sayCommand",ADMIN_KICK,"Whatever")
and then it check again in sayCommand()
i.e
PHP Code:
if (!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED
|
Really dont know, but sometimes if you create function without checking access, anybody can use it.
3.
PHP Code:
plugon = register_cvar("amx_whatever","1")
Variable "plugon" is only pointer to variable, not a value.
__________________