19.01.2013, 09:14
How can I make to admins can't ban main admin? My ban cmd:
Main admin enum:
Код:
CMD:ban( playerid, params[ ] ) { if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage( playerid, -1, "Tu ne administratorius!" ); new id, reason[ 64 ] ; if(sscanf( params, "us[64]", id, reason ) ) return SendClientMessage( playerid, -1, "Naudojimas: /ban [Nickas] [Prieћastis]" ); if( !IsPlayerConnected( id ) || id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "Tokio ћaidėjo nėra." ); new str[ 128 ], pName[ MAX_PLAYER_NAME ], aName[ MAX_PLAYER_NAME ] ; GetPlayerName( playerid, aName, MAX_PLAYER_NAME ); GetPlayerName( id, pName, MAX_PLAYER_NAME ); format( str, sizeof( str ), "%s Uћblokavo ћaidėją %s. (Prieћastis: %s)", aName, pName, reason ); SendClientMessageToAll( -1, str ); BanEx( id,str); return 1; }
Код:
if(PlayerInfo[playerid][pPadmin] == 1)