GetVehicleHealth isn't returning the correct value
#7



Once again, 1000.0 is not the max vehicle health! You can set it to whatever you want, you can even make it invulnerable if you set it high enough. I'm saying this because I've tried it, unlike some people who like to post even when they have no idea of what are they talking about...

No, it has nothing to do with the commans and decimal stuff, you can set the player/vehicle health to 99.9/999.9 and it will still work, and yes, I tried using integers (1001.0). It seems that GetPlayerHealth gets the old health, instead of the new health that has just been set; or maybe SetVehicleHealth sets it after GetVehicleHealth is called?

As I said, this should be synced:
pawn Code:
health_set();
value_updated();
get_health(); // Working with the new value.
It was tested on a localhost so if anyone asks, the bug has nothing to do with a bad internet. It doesn't happen when GetVehicleHealth wasn't called just after SetVehicleHealth.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)