GetVehicleHealth showing 1000 HP for attached vehicles
#1

When a trailer is attached to a vehicle, its health is continuously updated to 1000.0. GetVehicleHealth will return 1000.0 health, even if /dl shows the correct value. The visible damage (doors etc) is still ... visible.
I have also created a function to set the vehicle health to a specific value, then try to get the health with the native function.
pawn Код:
SetVehicleHealth(vehicleid, 795.2);
GetVehicleHealth(vehicleid, vHP);
The result stored in vHP is 795.2 (and some more decimals, not important right now), so in this case it works fine. The function above was executed while "vehicleid" was attached to the vehicle I was driving.
If you can, please try and reproduce it. I seriously doubt that this issue is caused by my script, since OnUnoccupiedVehicleUpdate and OnTrailerUpdate are not even used.

The trailer was attached with: https://sampwiki.blast.hk/wiki/AttachTrailerToVehicle
To get and set the health, I used:
- https://sampwiki.blast.hk/wiki/GetVehicleHealth
- https://sampwiki.blast.hk/wiki/SetVehicleHealth

EDIT: Forgot to mention, the server is running on 0.3z-R4-1000p.
Reply
#2

Are you using 0.3z-r4? r4 supposedly added some patches / fixes for trailer related hacks, so it is possible something was modified incorrectly pertaining to the trailer's health.
Reply
#3

Yes, I am using 0.3z-R4-1000p, linux version.
Reply
#4

Can you try replicating the issue in the 0.3z-r3(or a version below) server? I am highly sure it has something to do with the new trailer validation checks put in place in r4.
Reply
#5

I tested it on another gamemode (smaller, using a lot less callbacks than the first one, so it's cleaner) that is running on 0.3z-R1, the default 0.3z version. The results are the same.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)