Home   Help Search Login Register  

Author Topic: How to respawn inside a vehicle  (Read 1309 times)

0 Members and 1 Guest are viewing this topic.

iiillxlliii

  • Guest
How to respawn inside a vehicle
« on: 26 Feb 2005, 15:26:37 »
Thanks in advance to all who can help.

Trying to make a mission in which you fight in the skies with cessnas. when you are shot down by others, is it possible to respawn in the air with you as the pilot of cessna again ?

Any Suggestions will be most appreciated

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:How to respawn inside a vehicle
« Reply #1 on: 27 Feb 2005, 22:02:57 »
to be able to respawn in a vehicle.

do the following

1) addeventhandler killed to the player
2)have the eventhandler run a script
3) have the following entries in your respawn script

INIT.sqs
Quote
player addEventHandler ["killed", {_this exec "myrespawn.sqs"}]

myrespawn.sqs
Quote
player removeAllEventHandlers "Killed"
_pos = getpos player

@alive player
player addEventHandler ["killed", {_this exec "myrespawn.sqs"}]
_veh = "cessna" createVehicle _pos
_veh addweapon "machinegun30"
_veh addmagazine "machinegun30"
_veh addmagazine "machinegun30"
player moveindriver _veh
_veh flyinheight 100
exit


allow the unit to respawn in the normal way, eg at a respawn marker.
He will be instantaneously moved into the plane on respawn
« Last Edit: 27 Feb 2005, 22:04:41 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123