SA-MP Forums Archive
Anti Respawn - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Anti Respawn (/showthread.php?tid=198888)



Anti Respawn - ColdXX - 13.12.2010

Hello! I have 1 question. How to stop a car spawned with CreateVehicle to respawn?
Ive got different answers!

CreateVehicle(522, Pos[0], Pos[1], Pos[2],Angle, -1, -1,-1); this?

or

CreateVehicle(522, Pos[0], Pos[1], Pos[2],Angle, -1, -1,0);


Re: Anti Respawn - JaTochNietDan - 13.12.2010

It will re-spawn either way when it is destroyed, I recommend using DestroyVehicle in OnVehicleDeath to get rid of it when it is destroyed.

Although if you're talking about stopping it re-spawning automatically after a period of nobody using it, then -1 will do just fine, 0 will make it re-spawn instantly when someone stops using it.


Re: Anti Respawn - ColdXX - 13.12.2010

and since there is no "playerid" on that i have to create a loop right? Cuz im using something like this: veh[playerid]


Re: Anti Respawn - ColdXX - 13.12.2010

but i have a system that creates a car and places the player in it,and that car has to be destroyed to prevent "SPAM"
I have some parkour areas where there cant be many vehicles!


Re: Anti Respawn - PowerPC603 - 13.12.2010

Just create the car with a spawn-delay of 5 minutes or so.
Then when the car respawns (OnVehicleSpawn), simply destroy it (DestroyVehicle).

Make sure you hold the carID of that vehicle somewhere and check that in OnVehicleSpawn.
Else every vehicle that respawns will be destroyed.