Posts: 672
Threads: 89
Joined: Jan 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);
Posts: 2,502
Threads: 26
Joined: Apr 2007
Reputation:
0
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.
Posts: 672
Threads: 89
Joined: Jan 2010
and since there is no "playerid" on that i have to create a loop right? Cuz im using something like this: veh[playerid]
Posts: 672
Threads: 89
Joined: Jan 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!
Posts: 1,733
Threads: 20
Joined: Nov 2010
Reputation:
0
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.