Trailer health
#1

I am trying to get the trailer health when it gets detached, but it appears that the trailer does not get updated at all when detached. I have tried all the call backs including the new OnTrailerUpdate() and OnUnoccupiedVehicleUpdate().

Any ideas if I can check the health (or even if it has exploded/turned upside down)?
Reply
#2

As far as I know, vehicles that aren't actively being driven by players can't be damaged at all. That includes trailers. You can check if a vehicle is upside down with GetVehicleRotationQuat, but you will most likely have to convert those values to the Euler system.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
As far as I know, vehicles that aren't actively being driven by players can't be damaged at all. That includes trailers. You can check if a vehicle is upside down with GetVehicleRotationQuat, but you will most likely have to convert those values to the Euler system.
I have a IsVehicleUpsideDown with that function, but it still says the trailer is not upside down unless it is connected to my truck.

Quote:
Originally Posted by Gamer_Z
Посмотреть сообщение
https://sampforum.blast.hk/showthread.php?tid=446462
pawn Код:
stock IsVehicleUpsideDown(vehicleid)
{
    new
        Float:ZUP,
        Float:ZDOWN,
        Float:Unused;
    PositionFromVehicleOffset(vehicleid,0.0,0.0,1.0,Unused,Unused,ZUP);
    PositionFromVehicleOffset(vehicleid,0.0,0.0,-1.0,Unused,Unused,ZDOWN);
    return ZUP < ZDOWN;
}
If upside down, assume it's destroyed within <how many seconds till explosion?> seconds :P
Can you tell me how this function is different from the one mentioned above by Vince?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)