associate vehicle health to a certain player?
#4

pawn Код:
new Float:MostHealth, Float:vHealth, vDriver, veh;
for(new i; i < MAX_VEHICLES; i++)
{
     GetVehicleHealth(i, vHealth);
     if(vHealth > MostHealth)
     {
          MostHealth = vHealth;
          veh = i;
     }
}
vDriver = GetVehicleDriver(veh);
SetPlayerHealth(vDriver, (MostHealth/10));
That should, in theory, work. However it will work for all vehicles, not just ones in a certain area or assigned to a certain array, for example.

Modify it to suit your needs.
Reply


Messages In This Thread
associate vehicle health to a certain player? - by PawnoQ - 27.11.2011, 14:13
Re: associate vehicle health to a certain player? - by Ash. - 27.11.2011, 14:20
Re: associate vehicle health to a certain player? - by PawnoQ - 27.11.2011, 14:30
Re: associate vehicle health to a certain player? - by Ash. - 27.11.2011, 14:44
Re: associate vehicle health to a certain player? - by PawnoQ - 27.11.2011, 14:50
Re: associate vehicle health to a certain player? - by PawnoQ - 28.11.2011, 19:35
Re: associate vehicle health to a certain player? - by Ash. - 28.11.2011, 19:40
Re: associate vehicle health to a certain player? - by PawnoQ - 28.11.2011, 19:45

Forum Jump:


Users browsing this thread: 2 Guest(s)