05.12.2011, 15:05
That is not really hard.
This is the final product:
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
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;
}
}

