Vehicle death issue -
MP2 - 31.01.2014
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.
Re: Vehicle death issue -
pyrodojo25 - 31.01.2014
This needs to be fixed
Re: Vehicle death issue -
MP2 - 02.02.2014
A response from a dev/beta tester would be nice, as this is a pretty big issue.
Re: Vehicle death issue -
FufLa - 02.02.2014
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.
Re: Vehicle death issue -
Hanger - 02.02.2014
Set HP back?
OnVehicleStreamIn(**)
{
IF HP < 300.0
SETHP
}
Re: Vehicle death issue -
sony112502 - 02.02.2014
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.
Re: Vehicle death issue -
MP2 - 02.02.2014
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.
Re: Vehicle death issue -
DiDok - 02.02.2014
They DON'T CALL OnVehicleDeath - and that's the issue!
Re: Vehicle death issue -
sony112502 - 02.02.2014
OnVehicleDeath - This callback is called when a vehicle is destroyed - either by
exploding or becoming submerged in water.
Re: Vehicle death issue -
DiDok - 02.02.2014
Quote:
Originally Posted by pyrodojo25
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)
Re: Vehicle death issue -
Emre__ - 05.02.2014
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.
Re: Vehicle death issue -
RajatPawar - 05.02.2014
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;
}
Re: Vehicle death issue -
Konstantinos - 05.02.2014
Quote:
Originally Posted by Rajat_Pawar
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.
Re: Vehicle death issue -
Emre__ - 05.02.2014
Quote:
Originally Posted by Rajat_Pawar
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.
Re: Vehicle death issue -
RajatPawar - 05.02.2014
Quote:
Originally Posted by Konstantinos
|
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
Re: Vehicle death issue -
Konstantinos - 05.02.2014
Quote:
Originally Posted by Emre__
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.
Re: Vehicle death issue -
Emre__ - 05.02.2014
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.
Re: Vehicle death issue -
spell - 05.02.2014
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)
Respuesta: Re: Vehicle death issue -
Gryphus One - 05.02.2014
Quote:
Originally Posted by spell
Function like "DisableVehicleExploding ()" will be very good for rp servers!
|
Whoa, that function would be fucking awesome, not only for rp!!
Re: Vehicle death issue -
Reboma - 05.02.2014
Quote:
Originally Posted by spell
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.