Home   Help Search Login Register  

Author Topic: Nearly got it! Respawn in New Vehicles  (Read 1018 times)

0 Members and 1 Guest are viewing this topic.

chills

  • Guest
Nearly got it! Respawn in New Vehicles
« on: 15 Jan 2003, 09:56:46 »
I have edited Doolittle's vehicle script so that when the new veihcles respawn it can also spawn the players crew as well.

The only problem is that, when it spawns the crew gets spat out of the vehicle. So i need some one to pick out what the problem is.

All you need to do is put:
[this,gunnername,drivename,Commandersname] exec "vrs.sqs"

When this script is finnished you will be able to spawn in any vehicle or addons.

? not local Server : exit
_obj = _this select 0

_pos = getPos _obj
_dir = getDir _obj
_type = typeOf _obj


_driver = _this select 1
_gunner = _this select 2
_commander = _this select 3

_driver moveindriver _obj
_gunner moveingunner _obj
_commander moveincommander _obj



#clear
_t = 0

#alive
~3
? not alive _obj : _delay = 1; goto "notalive"

? fuel _obj == 1 : goto "clear"
? count crew _obj != 0 : goto "clear"

? _t == 0 : _t = _time + 60
? _t > _time : goto "alive"

"_obj removeMagazine _x" forEach magazines _obj
_obj setFuel 0
_obj setDamage 1
_delay = 10

#notalive
~_delay

deleteVehicle _obj
~1
_obj = _type createVehicle _pos
_obj setDir _dir


_driver = _this select 1
_gunner = _this select 2
_commander = _this select 3

_driver moveindriver _obj
_gunner moveingunner _obj
_commander moveincommander _obj

goto "clear"