Is Player Alive ?
#6

try this:

pawn Код:
SetTimerEx("OnServerUpdate", 1, true);

public OnServerUpdate()
{
    new count=0;
    for(new i; i < MAX_PLAYERS; i++)
    {
        new Float:hp;
        GetPlayerHealth(i, hp);
        if(hp > 1.0)
        {   count++;    }
    }
    if(count > 1)
    {
        // DO your coding here
    }
    //if you need this code i mentioned above, so for your info. this will detect if there is only one player alive
    if(count == 1)
    {
        // DO your coding here
    }
    return 1;
}
Reply


Messages In This Thread
Is Player Alive ? - by Champ - 20.06.2013, 15:37
Re: Is Player Alive ? - by trukker1998 - 20.06.2013, 15:42
Re: Is Player Alive ? - by Champ - 20.06.2013, 15:51
Re: Is Player Alive ? - by XSR - 20.06.2013, 15:55
Re: Is Player Alive ? - by rpg894 - 20.06.2013, 15:56
Re: Is Player Alive ? - by Excel™ - 20.06.2013, 15:58
Re: Is Player Alive ? - by TheOnlyRealFuzzy - 20.06.2013, 16:33
Re: Is Player Alive ? - by Excel™ - 20.06.2013, 16:56
Re: Is Player Alive ? - by Niko_boy - 20.06.2013, 17:00
Re: Is Player Alive ? - by TheOnlyRealFuzzy - 20.06.2013, 18:50

Forum Jump:


Users browsing this thread: 1 Guest(s)