biggest health amount
#2

pawn Код:
forward Detector();
public Detector() //Playerid parameter is not needed here!
{
    new Float:MostHealth, Float:vHealth, vDriver = -1;
    foreach(Player, i)
    {
        if(GetPlayerVehicleSeat(i) != 0) continue; //Ignores passengers and players that aren't in a vehicle
        GetVehicleHealth(GetPlayerVehicleID(i), vHealth);
        if(floatcmp(MostHealth, vHealth) == -1) //Checks if the health is higher than the one saved previously
        {
            MostHealth = vHealth;
            vDriver = i;
        }
    }
    if(vDriver == -1) return 0; //No players online...
    new name[MAX_PLAYER_NAME];
    GetPlayerName(vDriver, name, MAX_PLAYER_NAME);
    //Whatever you want to do with the name
    return 1;
}
Reply


Messages In This Thread
biggest health amount - by PawnoQ - 02.12.2011, 23:22
Respuesta: biggest health amount - by OPremium - 02.12.2011, 23:41
Re: biggest health amount - by PawnoQ - 03.12.2011, 02:05
Re: biggest health amount - by PawnoQ - 03.12.2011, 13:43
Re: biggest health amount - by PawnoQ - 04.12.2011, 12:02

Forum Jump:


Users browsing this thread: 2 Guest(s)