percentage
#1

im trying to do a simple percentage of damage a vehicle have, but it always return 0% when no damage (correct), but at the moment it get a damage, it return 100%, and when it take in fire it return 200%.

This is what i've tryied :
pawn Код:
GetVehicleHealth(vehicleid, domm);
domm1 = floatround(100 - 100*((domm/10)-25)/75));
Reply
#2

To work out a percentage:

(value/100)*25

That will give you 25% of something.
Reply
#3

look, a car default health is 1000, so i put it in percentage by dividing it by ten, then i remove the 25 where the car catch in fire, this will get me 75 when its full, so for a percentage it would be : (health/75)*100. then, i want it to be reversed, so i do 100-(health/75)*100, it work in real life but when i run that in the game it return 0, 100 or 200 %...
Reply
#4

(1000/100)*damage
Reply
#5

why the hell would i do damage*10 ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)