This is how I would do it:
PHP Code:
public cmdFunction(id, level, cid)
{
if( !cmd_access(id, level, cid, 1) )
{
return PLUGIN_HANDLED
}
ShowMainMenu(id)
}
ShowMainMenu(id)
{
// ...
}
public MainMenuHandler(...)
{
// ...
}
ShowSubMenu(id)
{
// ...
}
public SubMenuHandler(...)
{
// ...
case # { ShowMainMenu(id); }
}
Quote:
Originally Posted by wrecked_
You don't need that shit for level and cid. I don't know what you're doing, exactly, but here's an alternative.
Code:
if( !( get_user_flags( id ) & YOUR_ADMIN_FLAG ) )
{
return;
}
|
If you do it this way you can't change access flag.
To avoid using cmd_access() and still get do (and still be able to change it in cmdaccess.ini):
PHP Code:
function(id, level)
{
if( !(get_user_flags(id) & level) )
{
return PLUGIN_HANDLED
}
}
__________________