Anti Respawn
#1

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);
Reply
#2

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.
Reply
#3

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

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!
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)