recover between all the players which has the highest health
#3

I guess you wanna get the player id which has the most health .. I guess something like this should work;

pawn Код:
stock returnHighestHealthID()
{
    new Float:_health[2], pMost = INVALID_PLAYER_ID;
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i) || IsPlayerNPC(i)) continue;
        GetPlayerHealth(i, _health[0]);
        if(_health[0] > _health[1]) pMost = i, _health[1] = _health[0];    
    }
    return pMost;
}
Reply


Messages In This Thread
recover between all the players which has the highest health - by vardanega - 20.01.2011, 11:14
AW: recover between all the players which has the highest health - by NuggaN_ - 20.01.2011, 11:24
Re: recover between all the players which has the highest health - by woot - 20.01.2011, 11:29
[No subject] - by viKKmaN - 20.01.2011, 11:30
Re : recover between all the players which has the highest health - by vardanega - 20.01.2011, 11:42

Forum Jump:


Users browsing this thread: 2 Guest(s)