Vehicle Health and Fuel
#1

How to make 100% hp vehicle and 100 liters of fuel. I do not want to 1000% hp vehicle and 100.0 liters of fuel.

Health: 1000%
Fuel: 100.0 L
Код:
format(predstring_p, sizeof(predstring_p), "Health: %.0f%", health_car);
format(predstring_p, sizeof(predstring_p), "Fuel: %.1f L", Fuel[vehicleid]);
Reply
#2

you just have to remove one 0 from code, it's simple to divide it by 10.
format(predstring_p, sizeof(predstring_p), "Health: %.0f%", health_car/10);
Reply
#3

Quote:
Originally Posted by Mugala
Посмотреть сообщение
you just have to remove one 0 from code, it's simple to divide it by 10.
format(predstring_p, sizeof(predstring_p), "Health: %.0f%", health_car/10);
Incorrect to an extent. A vehicle catches fire at 250HP so you might want to re-calculate so that HP percentage is measured between 250.0 hp and 1000. hp.
Reply
#4

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Incorrect to an extent. A vehicle catches fire at 250HP so you might want to re-calculate so that HP percentage is measured between 250.0 hp and 1000. hp.
I think what Mugala tried to say is that only for display purposes, divide by 10 could be use. Originally if health is 800, on display it will show 80.0. I think thats what the OP wants too.
Reply
#5

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Incorrect to an extent. A vehicle catches fire at 250HP so you might want to re-calculate so that HP percentage is measured between 250.0 hp and 1000. hp.
I know, it's only visual part. (like KamilPolska asked)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)