SA-MP Forums Archive
Cars Respawning Too Fast? +REP - 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: Cars Respawning Too Fast? +REP (/showthread.php?tid=330899)



Cars Respawning Too Fast? +REP - TheMightyEddy - 02.04.2012

There has got to be something to delay my cars respawning. So when I exit out my vehicle for a 5-10 seconds, I the car respawns back to its original place. How do I delay my cars from respawning in game? And I'm talking about every car, each car does this. +REP.


Re: Cars Respawning Too Fast? +REP - iLcke - 03.04.2012

I'm guessing you're using AddStaticVehicleEx, so.

What I do is add a new line at the top with;

pawn Код:
#define never 9999999999999 (This number will be the amount of time the vehicle respawns)
And at the end of each AddStaticVehicleEx, there's a number of some sort, and just replace it with never. It's what I do, you don't NEED to define never.

Just at the end change the number.

pawn Код:
AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2, respawn_delay)
Respawn_delay is what you need to change.


Re: Cars Respawning Too Fast? +REP - MP2 - 03.04.2012

iLcke, -1 works.

Just set respawn_delay in AddStaticVehicleEx/CreateVehicle to -1. That prevents respawning.


Re: Cars Respawning Too Fast? +REP - TheMightyEddy - 03.04.2012

How can I set it to 10 minutes? And is there a faster way to do it to set at timer for all cars at once?


Re: Cars Respawning Too Fast? +REP - MP2 - 03.04.2012

respawn_delay is in seconds, so set it to 60*10.


Re: Cars Respawning Too Fast? +REP - TheMightyEddy - 03.04.2012

Okay thanks MP2 and is there a way to set it for all vehicle instead of putting it next to each vehicle line?


Re: Cars Respawning Too Fast? +REP - MP2 - 03.04.2012

You could use a define

#define RESPAWN_DELAY 60*10

Then just put that at the end of all your CreateVehicle lines.