SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Bug Reports (https://forum.sa-mp.com/forumdisplay.php?f=20)
-   -   GetVehicleHealth showing 1000 HP for attached vehicles (https://forum.sa-mp.com/showthread.php?t=564138)

HazardouS 19/02/2015 06:52 PM

GetVehicleHealth showing 1000 HP for attached vehicles
 
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 Code:
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: http://wiki.sa-mp.com/wiki/AttachTrailerToVehicle
To get and set the health, I used:
- http://wiki.sa-mp.com/wiki/GetVehicleHealth
- http://wiki.sa-mp.com/wiki/SetVehicleHealth

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

Abagail 19/02/2015 07:28 PM

Re: GetVehicleHealth showing 1000 HP for attached vehicles
 
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.

HazardouS 19/02/2015 07:39 PM

Re: GetVehicleHealth showing 1000 HP for attached vehicles
 
Yes, I am using 0.3z-R4-1000p, linux version.

Abagail 19/02/2015 08:52 PM

Re: GetVehicleHealth showing 1000 HP for attached vehicles
 
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.

HazardouS 20/02/2015 07:20 PM

Re: GetVehicleHealth showing 1000 HP for attached vehicles
 
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.

FaLLenGirL 01/05/2020 12:50 PM

Re: GetVehicleHealth showing 1000 HP for attached vehicles
 
This problem is still here on 0.3.7 R4.

Gforcez 24/05/2020 12:40 PM

Re: GetVehicleHealth showing 1000 HP for attached vehicles
 
Quote:

Originally Posted by FaLLenGirL (Post 4143165)
This problem is still here on 0.3.7 R4.

And it will stay, development stopped (as far as we know) so don't expect a bugfix for this.

ShadowMortar 05/06/2020 07:22 PM

Re: GetVehicleHealth showing 1000 HP for attached vehicles
 
Quote:

Originally Posted by Gforcez (Post 4147712)
And it will stay, development stopped (as far as we know) so don't expect a bugfix for this.

I've made this quickly, didn't test, but feel free to check it out:
https://pastebin.com/sPGvYKE9


All times are GMT. The time now is 06:35 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.