My 'transfer-to-helicopter' script is similar to an ejection script in the sense that I create a vehicle and transfer to that vehicle. It doesn't work as an independent action unless I tie it to the 'Eject' user action.
Script:
_array = _this select 0
_tank = _array select 1
_crew = _array select 2
_crew action ["GETOUT", _tank]
_helicopter = "AH64" createvehicle [0,0,0]
_helicopter setpos [(getpos _crew) select 0,(getpos _crew) select 1, ((getpos _crew) select 2)+5]
_helicopter setdir direction _tank
_crew moveindriver _helicopter
_helicopter engineon true
_vel = velocity _tank
_vx = (_vel select 0)
_vy = (_vel select 1)
_vz = 80 +(_vel select 2)
_helicopter setVelocity [_vx, _vy, _vz]
exit
Config.cpp
class switchchopper
{
displayName = "Switch To Chopper";
position = "OsaHlavne";
radius = 5;
condition = "alive this";
statement = "[this] exec {\VersatileTank\scripts\switch.sqs}";
};
The second problem is, once I get into this helicopter, I am unable to get into my previous Tank directly (Without exiting the helicopter and re-entering the tank manually) without creating a new one. I have insufficient knowledge of scripting to accomplish that.