Howdy...I woke up this morning and said, "hmmmm". Here's yet another Vehicle Respawn Script...this one, however, is only one script running...the "other" methods I've seen (& made myself) have 1 script running per vehicle, so with 20 vehicles on a map, you would have 20 seperate scripts running.
This is EXTREMELY easy to implement into your map. It will only work with 1.91 though (as typeOf is used).
1) So, to start.....for each vehicle's Initialization, put vehicles = vehicles + [this]. And then FOR THE FIRST VEHICLE YOU PLACE ON THE MAP you must put vehicles = [this] instead. But only for that first vehicle placed.
2) Then make a trigger that runs ONCE with: Condition: local Server OnActivation: [] exec "vehicles.sqs"
3) Then make a GameLogic called Server.
4) Then put this script in your mission's directory:
vehicles.sqs
;By Doolittle
_vpos = []
_vdir = []
_vtime = []
_count = count vehicles
_delay = 150
_i = 0
#load
_v = vehicles select _i
_vpos = _vpos + [[getPos _v select 0, getPos _v select 1, 0]]
_vdir = _vdir + [getDir _v]
_vtime = _vtime + [0]
_i = _i + 1
?_i < _count : goto "load"
#init
_i = 0
~3
#alive
_v = vehicles select _i
?fuel _v == 1 : goto "continue"
?alive _v and count crew _v != 0 : _vtime set [_i, 0]; goto "continue"
_vt = _vtime select _i
?_vt != 0 and _vt < _time : goto "notalive"
?_vt == 0 : _vtime set [_i, _time + _delay]
#continue
_i = _i + 1
?_i < _count : goto "alive"
goto "init"
#notalive
_vtype = typeOf _v
deleteVehicle _v
~1
_v = _vtype createVehicle (_vpos select _i)
_v setDir (_vdir select _i)
vehicles set [_i, _v]
_vtime set [_i, 0]
goto "continue"
Vehicles will respawn 150 seconds after being killed and they will also respawn if they are left empty for 150 seconds.
Enjoy!!
Doolittle
P.S. This is done by keeping an array of all vehicles, their start positions, direction facing, and then a timer for each vehicle for the 150 seconds delay.