It's not exactly like this, cmdSSmenu is called for every player who type command in his console.
You have to check admin access then.
You have to check with cmd_access :
PHP Code:
public plugin_init()
{
register_clcmd("amx_banmenu", "cmdSSmenu", ADMIN_BAN, "- displays ban menu");
}
// here, accessLevel is ADMIN_BAN because it has been registered like this, and as long as you don't change it in configs/cmdaccess.ini
public cmdSSmenu(id, accessLevel, commandIndex)
{
if( cmd_access(id, accessLevel, commandIndex, 0) )
{
// execute code here
}
return PLUGIN_HANDLED;
}
4th arg of cmd_access is the number of arguments required in order to the command can work correctly, command included, so in your case it's 1, but you can pass 0 as well, cmd_access will take in account that number as minimum, so if 1 arg is required, you can pass 0 or 1.
__________________