24.10.2011, 13:53
not to forget that a vehicle starts burning @ 250 HP, so the player would get 25 HP @ vehicledeath, but he deserves 0:
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)/10; SetPlayerHealth(playerid,health);
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);

