vehiclehealt = playerhealth
#4

not to forget that a vehicle starts burning @ 250 HP, so the player would get 25 HP @ vehicledeath, but he deserves 0:
Код:
new VehID=GetPlayerVehicle(playerid);
new Health=(GetVehicleHealth(VehID)-250.0)/10;
SetPlayerHealth(playerid,health);
but since the offset is 250.0, we need to scale the actual healthrange (0.0 to 75.0) up to (0.0 to 100.0),
this can be done by dividing Health by 3 (75/3=25), and multiplying it with 4:
Код:
new VehID=GetPlayerVehicle(playerid);
new Health=(GetVehicleHealth(VehID)-250.0)*40/25;
SetPlayerHealth(playerid,health);
Reply


Messages In This Thread
vehiclehealt = playerhealth - by cruising - 23.10.2011, 19:28
Re: vehiclehealt = playerhealth - by Michael@Belgium - 24.10.2011, 12:14
Re: vehiclehealt = playerhealth - by Jesus_wow - 24.10.2011, 12:21
Re: vehiclehealt = playerhealth - by Babul - 24.10.2011, 13:53

Forum Jump:


Users browsing this thread: 1 Guest(s)