|
Senior Member
|
01-22-2018
, 20:43
Re: [REQ] Small ADMIN_LEVEL help
|
#11
|
Quote:
Originally Posted by Bugsy
You need to separate the "/prefix" check and permission check.
PHP Code:
public HookSay(id)
{
read_args( g_typed , charsmax( g_typed ) )
remove_quotes(g_typed)
trim( g_typed )
server_print( "[%s]" , g_typed) ;
if ( !g_typed[ 0 ] )
return PLUGIN_HANDLED;
if ( equal( g_typed , "/prefix" ) )
{
if ( get_user_flags( id ) & ADMIN_BAN )
{
client_print(id, print_chat, "%L", LANG_SERVER, g_toggle[id] ? "PREFIX_OFF" : "PREFIX_ON" , in_prefix)
g_toggle[id] = !g_toggle[id];
}
else
{
client_print( id , print_chat , "You do not have access." );
}
}
return PLUGIN_HANDLED;
}
|
Thank you!
There is warnings but everything works fine!
|
|
|
|