SA-MP Forums Archive
SetVehicleHealth Respawning Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SetVehicleHealth Respawning Problem (/showthread.php?tid=488611)



SetVehicleHealth Respawning Problem - iRage - 18.01.2014

There's a strange bug I've met today when playing around.

I tried setting a vehicle's hp to 0, it caught on fire and exploded but never respawned again.
When I went out of the stream distance and went back in, the vehicle was there on fire again.
I tried setting different values of HP to make sure the problem isn't with the zero, but still same thing.

When bringing the vehicle's health down normally (Shooting the vehicle or smashing into walls) it would respawn properly.


Confirm this please.


Re: SetVehicleHealth Respawning Problem - MP2 - 18.01.2014

I also experienced this.


Re: SetVehicleHealth Respawning Problem - Basssiiie - 18.01.2014

What if you set the HP to 1 or anything between 1 and 250? If I remember correctly, the vehicle starts catching fire at 250 HP and lower as well.


Re: SetVehicleHealth Respawning Problem - Calgon - 18.01.2014

Quote:
Originally Posted by Basssiiie
Посмотреть сообщение
What if you set the HP to 1 or anything between 1 and 250? If I remember correctly, the vehicle starts catching fire at 250 HP and lower as well.
We tried 249, and it still happened.


Re: SetVehicleHealth Respawning Problem - iRage - 18.01.2014

Quote:
Originally Posted by Basssiiie
Посмотреть сообщение
What if you set the HP to 1 or anything between 1 and 250? If I remember correctly, the vehicle starts catching fire at 250 HP and lower as well.
Quote:
Originally Posted by iRage
Посмотреть сообщение
I tried setting different values of HP to make sure the problem isn't with the zero, but still same thing..
(4char)


Re: SetVehicleHealth Respawning Problem - Battlezone - 18.01.2014

Before you set the vehicle hp under 250, make a variable for that vehicle example
new VehicleDamned[MAX_VEHICLES] on top of your gm
when you set it add VehicleDamned[Vehicleid] = 1;
Under OnVehicleStreamIn, put this ( im using ipad sorry i cant give the exact code) :
If(VehicleDamned[Vehicleid] == 1)
{
VehicleDamned[Vehicleid] = 0;
//set the vehicle hp to the normal hp
}
I just gave you the temporary solution, didnt test it but i think it will work


Re: SetVehicleHealth Respawning Problem - pyrodojo25 - 18.01.2014

Confirmed.

If vehicle wasn't ocuppied at least once
after spawning, OnVehicleDeath won't be
called and vehicle won't respawn after death.

But it's not 0.3z issue. Tested on 0.3x and 0.3z RC2


Re: SetVehicleHealth Respawning Problem - Pasa - 19.01.2014

this happens also in 0.3x I have also noticed it..


Re: SetVehicleHealth Respawning Problem - 2KY - 19.01.2014

Would be great to have this fixed, such an annoying bug and my players have died countless times to this.


Re: SetVehicleHealth Respawning Problem - Pottus - 19.01.2014

Doesn't matter if the vehicle was occupied or not it appears to be a client bug so even if you go in the vehicle log off then log back in this bug will happen for the client. Simply stop damaging the vehicle below 250.0hp and set a timer that will call SetVehicleToRespawn()


Re: SetVehicleHealth Respawning Problem - AIped - 22.02.2014

Quote:
Originally Posted by [uL]Pottus
View Post
Doesn't matter if the vehicle was occupied or not it appears to be a client bug so even if you go in the vehicle log off then log back in this bug will happen for the client. Simply stop damaging the vehicle below 250.0hp and set a timer that will call SetVehicleToRespawn()
Can you explain how SetVehicleToRespawn works fixing this bug? because the problem happens at respawn right ?