I have a problem with this script. res.sqs, (this) is run on all vehicles that I want respawned. The police jeeps have sirens, and they work great, but when I blow the jeeps up, they respawn and they no longer have the action of turning the siren on and off. Can someone help me fix this script? I put [this] exec "res.sqs" in the vehicles I want respawned. When I host my own server, other people can't use the siren but I can (being the local server).;Vehicle respawn script
_car = _this select 0
_type = typeof _car
_carpos = getpos _car
_cardir = getdir _car
_crew = []
_crew = crew _car
_count = 50
_once = false
;If it's a police jeep, give it the siren ability
testjeep = "JeepPolice"
? testjeep == typeof _car : siren = _car addAction ["Turn siren on", "siren.sqs"]
;If no one is in the car, respawn it after a while
#loop
_crew = crew _car
?((count _crew) != 0) : _once = true
?((count _crew) == 0) and (_once) : goto "nodriver"
#2
?((fuel _car) < 0.05) : goto "ofuel"
?((getdammage _car) > .33) : goto "do"
?((getdammage _car) <= .33) : goto "repair"
~10
goto "loop"
#do
~2
_car setfuel ((fuel _car) - 0.08)
~0.5
_car setfuel ((fuel _car) - 0.08)
~0.5
_car setfuel ((fuel _car) - 0.08)
~0.5
_car setfuel ((fuel _car) - 0.08)
~0.5
_car setfuel ((fuel _car) - 0.08)
~0.5
_car setfuel ((fuel _car) - 0.08)
~0.5
_car setfuel ((fuel _car) - 0.08)
~0.5
_car setfuel ((fuel _car) - 0.08)
~0.5
~10
_car setfuel ((fuel _car) - 0.08)
~0.5
_car setfuel ((fuel _car) - 0.08)
~0.5
_car setfuel ((fuel _car) - 0.08)
~0.5
_car setfuel ((fuel _car) - 0.08)
~0.5
_car setfuel ((fuel _car) - 0.08)
~0.5
_car setfuel ((fuel _car) - 0.08)
~0.5
_car setfuel ((fuel _car) - 0.08)
~0.5
_car setfuel ((fuel _car) - 0.08)
~0.5
_car setpos getmarkerpos "hospital"
~0.1
#direct
deletevehicle _car
~30.0
?!(local Server) : goto "eheh"
_car = _type createVehicle _carpos
_car setdir _cardir
_car setpos _carpos
#eheh
ClearWeaponCargo _car; clearMagazineCargo _car
testjeep = "JeepPolice"
? testjeep == typeof _car : siren = _car addAction ["Turn siren on", "siren.sqs"]
_car addAction ["Lock vehicle", "lockListener.sqs"]
goto "loop"
#repair
~8
?((getdammage _car) > .3) : goto "do"
_dammage = getdammage _car
_car setdammage _dammage
goto "loop"
#ofuel
~20
?((fuel _car) < 0.05) : goto "do"
goto "loop"
#nodriver
~1
_count = _count - 1
? (_count == 0) : _count = 15; goto "sure"
goto "2"
#sure
?((count _crew) != 0) : goto "2"
_once = false
goto "direct"
I would also like to know if it is even possible to respawn a crate and all of it's contents.