Checking if there is someone alive.
#3

pawn Код:
//
new players_alive;
for(new i; i < MAX_PLAYERS; i++)
{
    new Float:player_health;
    GetPlayerHealth(i, player_health);
    if(player_health > 0 || GetPlayerState(i) != PLAYER_STATE_WASTED)// Change it if needed.
    {
        players_alive++;
    }
}

if(players_alive == 1) SendClientMessageToAll(-1,  "There is only one person alive");
else if(players_alive > 1) SendClientMessageToAll(-1,  "There is players alive");
//
Reply


Messages In This Thread
Checking if there is someone alive. - by ValentinLaw - 18.08.2012, 22:32
Re: Checking if there is someone alive. - by ReVo_ - 18.08.2012, 22:39
Re: Checking if there is someone alive. - by Larceny - 18.08.2012, 22:51
Re: Checking if there is someone alive. - by Youice - 18.08.2012, 23:44
Re: Checking if there is someone alive. - by ValentinLaw - 21.08.2012, 18:39
Re: Checking if there is someone alive. - by Finn - 21.08.2012, 19:52

Forum Jump:


Users browsing this thread: 2 Guest(s)