Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Phonix644

How to teleport player in gunner to pilot/back seat?

Recommended Posts

Hey Guys,

I am trying to find out how to make on a trigger or such, how to teleport a player who is in the gunner seat of a helicopter to another seat, such as the pilot seat. I couldn't find any other posts on this.

Thanks Guys

Share this post


Link to post
Share on other sites

The commands are these:

player moveindriver _heli;

player moveingunner _heli;

player moveincargo _heli;

If the place taken before use that commands You must free the place where you want to

send the player so:

_Name=(driver _Heli);

_Name action ["Eject", _Heli];

deleteVehicle _Name;

player moveindriver _Heli;

Of course You can use it also for the others commands (moveincargo,moveingunner)

Share this post


Link to post
Share on other sites

Thanks for the reply mate,

Yeah I do have a bot in the drivers seat and need to get him to eject and me into the player seat.

Assume that:

Player1 is the bot

Player2 is the human

So I put this into a trigger (blufor present):

player1=(driver Heli); player1 action ["Eject", Heli]; deleteVehicle player1; player2 moveindriver Heli;

But that doesn't work, do you know what I am doing wrong?

Cheers Mate

Share this post


Link to post
Share on other sites

player1=(driver Heli); player1 action ["Eject", Heli]; deleteVehicle player1; player2 moveindriver Heli;

add this:

unassignvehicle player1;

sleep 1;

so try this:

player1=(driver Heli); unassignvehicle player1;player1 action ["Eject", Heli];sleep 1; deleteVehicle player1; player2 moveindriver Heli;

Share this post


Link to post
Share on other sites

Couldn't you just make all players, playable, and then just switch to that player you want to be in, works for me, at least in SP.

Share this post


Link to post
Share on other sites
Couldn't you just make all players, playable, and then just switch to that player you want to be in, works for me, at least in SP.

Teamswitch in MP causes all kinds of stupid problems, especially with tasks. The problem is he's got an encounter where players are on guns on an AI piloted Blackhawk but then they want to ACE fastrope after an attack run so they need a human pilot. Using the ASR AI fastrope apparently isn't an option.

Share this post


Link to post
Share on other sites

See if you can get this to work, it does for me. There is a little lag on the first switch and make sure you have enough height as engine will throttle down for a second or two.

Place the function module on the map to be safe.

// Add the folowing two addaction commands to the init of the chopper, save script as "swap_seat.sqf"
//
// this addAction ["To Gunner Seat","swap_seat.sqf",[],1,false,true,"","( driver _target == _this)"];
// this addAction ["To Pilot Seat","swap_seat.sqf",[],1,false,true,"","( gunner _target == _this)"];

_veh = _this select 0;
_unit = _this select 1;

_gunner = gunner _veh;
_driver = driver _veh;

_engine = isengineon _veh;

if ([assignedVehicleRole _unit, ["driver"]] call BIS_fnc_areEqual) then {
      _gunner setpos [0,0,0];
      _driver setpos [0,0,0];
      _driver moveingunner _veh;
      _gunner moveindriver _veh;
  } else {
     _driver setpos [0,0,0];
     _gunner setpos [0,0,0];
     _gunner moveindriver _veh;
     _driver moveingunner _veh;
};

_veh engineon _engine; // AI won't turn engine on unless they have a destination this forces it on

Edited by F2k Sel

Share this post


Link to post
Share on other sites
Sign in to follow this  

×