GetVehicleHealth? [!+rep!] :)
#1

hi,

how can i check what player is driving the vehicle with the most health atm?
(vehicle health NOT player health!)

Would be happy about help, cause this code is not working well:

pawn Код:
//im using this in a timer:
forward Detector();
public Detector()
{
    new Float:MostHealth, Float:vHealth, vDriver;
    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;
        }
    }
    new name[MAX_PLAYER_NAME];
    GetPlayerName(vDriver, name, MAX_PLAYER_NAME);
    //here i want to get the name of the player that is driving the vehicle with the most health...
    //...
    return 1;
}
thx
Reply


Messages In This Thread
GetVehicleHealth? [!+rep!] :) - by PawnoQ - 05.12.2011, 14:55
Re: GetVehicleHealth? [!+rep!] :) - by Pinguinn - 05.12.2011, 15:05
Re: GetVehicleHealth? [!+rep!] :) - by PawnoQ - 05.12.2011, 15:10
Re: GetVehicleHealth? [!+rep!] :) - by Pinguinn - 05.12.2011, 15:10
Re: GetVehicleHealth? [!+rep!] :) - by PawnoQ - 05.12.2011, 15:14
Re: GetVehicleHealth? [!+rep!] :) - by Pinguinn - 05.12.2011, 15:18
Re: GetVehicleHealth? [!+rep!] :) - by PawnoQ - 05.12.2011, 17:36
Re: GetVehicleHealth? [!+rep!] :) - by Devran - 05.12.2011, 18:04
Re: GetVehicleHealth? [!+rep!] :) - by PawnoQ - 05.12.2011, 19:26
Re: GetVehicleHealth? [!+rep!] :) - by Pinguinn - 05.12.2011, 20:09

Forum Jump:


Users browsing this thread: 1 Guest(s)