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

That is not really hard.
This is the final product:

pawn Код:
new __vHealth, Float:_vHealth, Float:vHealth_update = 0;

for(new iii; iii < MAX_PLAYERS; iii++) {
    __vHealth = GetVehicleHealth(iii, _vHealth);
    if(__vHealth > vHealth_update) {
        vHealth_update = __vHealth;
    }
}
What does it actually do? It first creates 3 vars. Vehicle Health (Float:__vHealth), varname for the vehicle health of the player (_vHealth) and one which retrieves the most health. Because var "vHealth_update" starts at 0, the var will change immediatly after the loop. It loops through all players, but while looping, variable "vHealth_update" gets updated each time someone else has a higher health. See it as an estafette. If you run first, and you have become a bit tired, you have not alot energy. However, the guy in front of you has more energy, so you pass the stick to him (vHealth_update). I hope I explained it good enough
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)