Vehicle death issue
#1

Un-occupied vehicle.
SetVehicleHealth to 0.
It explodes.
After ~5 seconds, it disappears.
It never respawns.

If you leave the area and come back (stream the vehicle out and back in) it's back and on fire, explodes again, and disappears again, rinse and repeat.

Is bug.
Pls fix.
Thx men.
Reply
#2

This needs to be fixed

Reply
#3

A response from a dev/beta tester would be nice, as this is a pretty big issue.
Reply
#4

This is AFAIK a known bug when you set the vehicle hp below 250 on a vehicle without any users in it (that could possibly sync its state). Best is to never let the hp go below 251 (I assume you're using the new callback to add unoccupied vehicle damage to your server?).

Would be nice though if it was fixed in a future RC/SA-MP version.
Reply
#5

Set HP back?

OnVehicleStreamIn(**)
{
IF HP < 300.0
SETHP
}
Reply
#6

The issue is only in Un-occupied vehicle.

if anyone enter the vehicle, it will not be a problem.


Sorry, My English is not good.
Reply
#7

A fix could probably be scripted for this in PAWN by manually respawning the vehicle 5 seconds after OnVehicleDeath, but it's still a client bug.
Reply
#8

They DON'T CALL OnVehicleDeath - and that's the issue!
Reply
#9

OnVehicleDeath - This callback is called when a vehicle is destroyed - either by exploding or becoming submerged in water.
Reply
#10

Quote:
Originally Posted by pyrodojo25
View Post
It's not called if vehicle is not occupied
It's not called if vehicle was NEVER occupied before - after you enter it, it becomes responsive (both trailers and normal vehicles)
Reply
#11

Quote:
Originally Posted by MP2
Посмотреть сообщение
A fix could probably be scripted for this in PAWN by manually respawning the vehicle 5 seconds after OnVehicleDeath, but it's still a client bug.
Yeah about that I tried the Hanger's method, re-spawning the car, is not the solution. Yes the vehicle is not on fire when streamed in back but the OnVehicleDeath is still not called.
Reply
#12

Would this work? If it doesn't, please do explain why!

pawn Code:
public OnVehicleStreamIn( vehicleid )
{
       new Float: vH;
       GetVehicleHealth( vehicleid , vH );
       if(  vH < MIN_HEALTH_LIMIT )
       {
            DestroyVehicle( vehicleid );
       }
      return 1;
}
Reply
#13

Quote:
Originally Posted by Rajat_Pawar
View Post
Would this work? If it doesn't, please do explain why!

pawn Code:
public OnVehicleStreamIn( vehicleid )
{
       if( GetVehicleHealth( vehicleid ) < MIN_HEALTH_LIMIT )
       {
            DestroyVehicle( vehicleid );
       }
      return 1;
}
https://sampwiki.blast.hk/wiki/GetVehicleHealth

The health is passed by reference.
Reply
#14

Quote:
Originally Posted by Rajat_Pawar
View Post
Would this work? If it doesn't, please do explain why!

pawn Code:
public OnVehicleStreamIn( vehicleid )
{
       new Float: vH;
       GetVehicleHealth( vehicleid , vH );
       if(  vH < MIN_HEALTH_LIMIT )
       {
            DestroyVehicle( vehicleid );
       }
      return 1;
}
Destroying a vehicle deletes the car from the script so it will not re-spawn. We want the vehicle re-spawn and call the callback OnVehicleDeath.
Reply
#15

Quote:
Originally Posted by Konstantinos
View Post
https://sampwiki.blast.hk/wiki/GetVehicleHealth

The health is passed by reference.
I kind of already know that, I was just being lazy! If it matters so much, I'll change it

Anyways, back on-topic, SetVehicleToRespawn or stuff might work
Reply
#16

Quote:
Originally Posted by Emre__
View Post
We want the vehicle re-spawn and call the callback OnVehicleDeath.
pawn Code:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
    new
        Float: vH;
       
    GetVehicleHealth(vehicleid, vH);
    if (vH < 250.0)
    {
        CallRemoteFunction("OnVehicleDeath", "ii", vehicleid, forplayerid);
        SetTimerEx("RespawnBuggedVehicle", 1000, false, "i", vehicleid);
    }
    return 1;
}

forward RespawnBuggedVehicle(vehicleid);
public RespawnBuggedVehicle(vehicleid)
{
    SetVehicleToRespawn(vehicleid);
}
It calls OnVehicleDeath, it re-spawns the vehicle and OnVehicleSpawn is called too after that. I'm not really sure whether it's going to work well with more players.
Reply
#17

I also tried to Destroy and Re-Create the vehicle but the newly created vehicle comes with the ID of the deleted one so nothing is changed. Callback OnPlayerDeath is still not called. SetVehicleToRespawn and DestroyVehicle and CreateVehicle again do not work because either way they'll have the same ID.

- I think from now on this issue on the Kalcor's hand.
Reply
#18

i think vehicle explosions need to be server-sided. If vehicle is unoccupied call onvehicledeath (vehicleid, INVALID_PLAYER_ID) but server-sided count down for vehicle exploding.. Its really desynced! If player pause while vehicle is in fire its explode for other streamed players. Function like "DisableVehicleExploding ()" will be very good for rp servers! Also for make server-sided and synced vehicle explosion (using the exploding object and manually respawn the vehicle)
Reply
#19

Quote:
Originally Posted by spell
View Post
Function like "DisableVehicleExploding ()" will be very good for rp servers!
Whoa, that function would be fucking awesome, not only for rp!!
Reply
#20

Quote:
Originally Posted by spell
View Post
Function like "DisableVehicleExploding ()" will be very good for rp servers! Also for make server-sided and synced vehicle explosion (using the exploding object and manually respawn the vehicle)
That function would be nice!
We never destroy vehicles on RP server (they have to fix them before use it again) so i hope they add this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)