18.08.2012, 22:39
new bool:Alive[MAX_PLAYERS] = {true,...};
OnPlayerConnect:
Alive[playerid]=true;
OnPlayerDisconnect
Alive[playerid] = false;
OnPlayerDeath
Alive[playerid] = false;
Where u want to check
new alives = 0;
for ( new i = 0 , j = GetMaxPlayers( ) ; i < j ; ++ i ) {
if( ! IsPlayerConnected( i ) ) continue;
if( Alive[ i ] == false ) continue;
alives ++;
}
if ( alives == 1 ) {
SendClientMessageToAll( -1 , "one is alive" );
}
OnPlayerConnect:
Alive[playerid]=true;
OnPlayerDisconnect
Alive[playerid] = false;
OnPlayerDeath
Alive[playerid] = false;
Where u want to check
new alives = 0;
for ( new i = 0 , j = GetMaxPlayers( ) ; i < j ; ++ i ) {
if( ! IsPlayerConnected( i ) ) continue;
if( Alive[ i ] == false ) continue;
alives ++;
}
if ( alives == 1 ) {
SendClientMessageToAll( -1 , "one is alive" );
}