[HELP] last admin on server
#1

Hello how can I make example two admins are on the server and one of that admin disconnect and stay one admin and my question know is how can I make when last admin leave(disconnect)from server then it send to all players some message ? Thanks
Reply
#2

Replace IsPlayerAdmin with the variable you store the player's admin level.

pawn Код:
public OnPlayerDisconnect( playerid, reason )
{
    if( IsPlayerAdmin( playerid ) )
    {
        new
            count
        ;
        for( new i; i != MAX_PLAYERS; i++ )
        {
            if( IsPlayerConnected( i ) && IsPlayerAdmin( i ) && i != playerid ) count++;
        }
        if( !count) SendClientMessageToAll( -1, "All the admins have left." );
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)