Vehicle destruction respawn delay
#1

Hello!

After vehicle is destroyed, it will be re spawned immediately. Is there a way to set delay on this?
Reply
#2

yup ... Destroy and delete the vehicle, then recreate based on a ticker.
Reply
#3

Quote:
Originally Posted by Joshua_Turnerz
Посмотреть сообщение
yup ... Destroy and delete the vehicle, then recreate based on a ticker.
Or did you mean a timer ?
Reply
#4

No need for timers etc.

https://sampwiki.blast.hk/wiki/AddStaticVehicleEx
Reply
#5

no, Ticker ... Timers = Evil!

Most cores usually already have a timer running based on 1 second intervals ... ists easy enough, to simply use that existing timer, add a variable ticker, to kick off a function.

As you've seen in my core, I avoid timers as much as possible.
Reply
#6

Can't u just change the spawn time when adding a static vehicle? (or createvehicle?)
that's pretty much the easiest way...
Reply
#7

Quote:
Originally Posted by Joshua_Turnerz
Посмотреть сообщение
no, Ticker ... Timers = Evil!

Most cores usually already have a timer running based on 1 second intervals ... ists easy enough, to simply use that existing timer, add a variable ticker, to kick off a function.

As you've seen in my core, I avoid timers as much as possible.
Then he can easily use AddStaticVehicleEx
Reply
#8

Errrmmm.. Guys, I was first to talk about AddStaticVehicleEx :P
Reply
#9

Quote:
Originally Posted by Tigerbeast11
Посмотреть сообщение
Errrmmm.. Guys, I was first to talk about AddStaticVehicleEx :P
Correction, wiki.sa-mp.com was the first to talk about it, actually.. lol
Reply
#10

because your limiting your options...

lets say, after a car blows up ... you want it gone for like 1 hour ...
you can simply loop any array, and check for a timestamp that is out of date, then recreate the vehicle based on those saved variables.

Its pointless to have timers floating around for an hour, not to mention the possibility of all the timer collisions ..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)