750 Vehicle Health to %?
#1

Hi all,

A vehicle have 1000 health.
The vehicle explode on 250 health.
How can i change the health to %?
So like when my vehicle has 375 health the vehicle is 50 % damaged.

Admigo
Reply
#2

pawn Код:
new
    Float:health,
    Float:percent;

GetVehicleHealth(vehicleid, health);
percent = (((health - 250.0) / (1000.0 - 250.0)) * 100.0);
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
pawn Код:
new
    Float:health,
    Float:percent;

GetVehicleHealth(vehicleid, health);
percent = (((health - 250.0) / (1000.0 - 250.0)) * 100.0);
Omg, I feel dumb that i didnt know this. Thanks Rep +.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)