I tryed to make command
say .newadmin nick but if i enter it in chat nothing happens, if i enter though console it works fine... i can`t understand why this happens
PHP Code:
register_clcmd( "say .newadmin", "CmdNewAdmin", GH_ADMIN );
public CmdNewAdmin( id, level, cid ) {
if( !cmd_access( id, level, cid, 2 ) )
return PLUGIN_CONTINUE;
new szArg[ 32 ];
read_argv( 2, szArg, charsmax( szArg ) );
client_print( 0, print_chat, "%s", szArg );
new iPlayer = GHFindPlayer( id, szArg );
if( !iPlayer )
return PLUGIN_CONTINUE;
if( !( get_user_flags( iPlayer ) & GH_ADMIN ) ) {
ColorChat( id, DontChange, "%s^1 This player can`t be gather admin, because he doesn`t have premium!", g_szPrefix );
return PLUGIN_CONTINUE;
}
menu_display( iPlayer, g_iMenu_NewAdmin, 0 );
g_iOldAdmin = id;
return PLUGIN_CONTINUE;
}
stock GHFindPlayer( id, const szArg[ ] ) {
new iPlayer = find_player( "bl", szArg );
if( iPlayer ) {
if( iPlayer != find_player( "blj", szArg ) ) {
ColorChat( id, DontChange, "%s^1 There are more clients matching to your argument.", g_szPrefix );
return 0;
}
}
else if( szArg[ 0 ] == '#' && szArg[ 1 ] ) {
iPlayer = find_player( "k", str_to_num( szArg[ 1 ] ) );
}
if( !iPlayer ) {
ColorChat( id, DontChange, "%s^1 Client with that name or userid not found.", g_szPrefix );
return 0;
}
if( is_user_bot( iPlayer ) ) {
ColorChat( id, DontChange, "%s^1 That action can't be performed on bot.", g_szPrefix );
return 0;
}
return iPlayer;
}
__________________