Basically the answer is, if you do not want to read all this code,
is to tell the pilot to disembark, when he gets close enough to
the ground tell him to halt. The following method is what I
use. I create an addaction button for my heli, when I want to
return to base, I just hit the RTB button in the heli, it takes
me to my base, and lands exactly on the helicopter without
getting out. I have other scripts as well. Check out my
Helicopter Insertion and Extraction by Matthew Sibley And FullMetal (harold5187)
Note: Use the minimal addon version, it's easier to deal with and has
links to those two addons needed.
titleText[">>> Order confirmed! Chopper RTB! <<<", "PLAIN DOWN"];
_Heli=_this select 3
_Pilot= driver _Heli;
#RestartErr2
"W1LZMkr" setmarkerpos getmarkerpos "W1EvacRTB";
W1LZ setdir 180;
W1LZ setpos getmarkerpos "W1LZMkr";
~2
(vehicle _Pilot) doMove (position W1LZ);
#Restart1
(vehicle _Pilot) flyinheight 200;
(vehicle _Pilot) setspeedmode "FULL";
? ((!(_Pilot in _Heli))||(!(alive _Heli))||(!(alive _Pilot))||(!(canmove _Heli))): goto "Cont";
Hint Format["Dist > 3000 ETA %1",_Heli distance W1LZ];
? ((_Heli distance W1LZ) > 3000): goto "Restart1";
#Restart2
(vehicle _Pilot) flyinheight 150;
(vehicle _Pilot) setspeedmode "NORMAL";
? ((!(_Pilot in _Heli))||(!(alive _Heli))||(!(alive _Pilot))||(!(canmove _Heli))): goto "Cont";
Hint Format["Dist > 2000 ETA %1",_Heli distance W1LZ];
? ((_Heli distance W1LZ) > 2000): goto "Restart2";
#Restart3
(vehicle _Pilot) flyinheight 105;
(vehicle _Pilot) setspeedmode "LIMITED";
? ((!(_Pilot in _Heli))||(!(alive _Heli))||(!(alive _Pilot))||(!(canmove _Heli))): goto "Cont";
Hint Format["Dist > 1000 ETA %1",_Heli distance W1LZ];
? ((_Heli distance W1LZ) > 1000): goto "Restart3";
#Restart4
(vehicle _Pilot) flyinheight 90;
(vehicle _Pilot) setspeedmode "LIMITED";
? ((!(_Pilot in _Heli))||(!(alive _Heli))||(!(alive _Pilot))||(!(canmove _Heli))): goto "Cont";
Hint Format["Dist > 600 ETA %1",_Heli distance W1LZ];
? ((_Heli distance W1LZ) > 600): goto "Restart4";
#Restart5
(vehicle _Pilot) flyinheight 70;
(vehicle _Pilot) setspeedmode "LIMITED";
? ((!(_Pilot in _Heli))||(!(alive _Heli))||(!(alive _Pilot))||(!(canmove _Heli))): goto "Cont";
Hint Format["Dist > 300 ETA %1",_Heli distance W1LZ];
? ((_Heli distance W1LZ) > 300): goto "Restart5";
#Restart6
(vehicle _Pilot) flyinheight 25;
(vehicle _Pilot) setspeedmode "LIMITED";
? ((!(_Pilot in _Heli))||(!(alive _Heli))||(!(alive _Pilot))||(!(canmove _Heli))): goto "Cont";
Hint Format["Dist > 150 ETA %1",_Heli distance W1LZ];
? ((_Heli distance W1LZ) > 150): goto "Restart6";
_Heli land "Get Out";
#Restart7
(vehicle _Pilot) flyinheight 15;
(vehicle _Pilot) setspeedmode "LIMITED";
? ((!(_Pilot in _Heli))||(!(alive _Heli))||(!(alive _Pilot))||(!(canmove _Heli))): goto "Cont";
Hint Format["Dist > 25 ETA %1",_Heli distance W1LZ];
? ((_Heli distance W1LZ) > 25): goto "Restart7";
#Restart8
(vehicle _Pilot) flyinheight 15;
(vehicle _Pilot) setspeedmode "LIMITED";
? ((!(_Pilot in _Heli))||(!(alive _Heli))||(!(alive _Pilot))||(!(canmove _Heli))): goto "Cont";
Hint Format["Dist > 15 ETA %1",_Heli distance W1LZ];
? ((_Heli distance W1LZ) > 15): goto "Restart8";
_Heli land "LAND";
(vehicle _Pilot) flyinheight 0;
Hint "Landed!";
goto "ContEnd";
#Cont
? ((!(alive _Heli))||(!(alive _Pilot))): goto "ContErr1";
? (((alive _Pilot)&&(_Pilot in _Heli))&&(!(canmove _Heli))): goto "ContErr2";
? ((!(alive _Pilot))&&(canmove _Heli)||(!(canmove _Heli))): goto "ContErr3";
? (!(_Pilot in _Heli)): goto "ContErr4";
goto "ContEnd";
#ContErr1
Hint "RTB Failure: Chopper and crew destroyed!";
goto "ContEnd";
#ContErr2
_Heli setdammage 0;
_Heli setfuel 1;
Hint "RTB Warning: Making repairs and attempting to continue mission!";
goto "RestartErr2";
#ContErr3
Hint "RTB Failure: Pilot Killed! Destroying chopper (20 Secs)!";
~20
_Heli Setdammage 1;
goto "ContEnd";
#ContErr4
Hint "MAYDAY!!! MAYDAY!!! Chopper destroyed! I'm bailing and need rescue!";
goto "ContEnd";
#ContEnd
dostop (vehicle _Pilot);
exit
This is the part of the script you are interested in. How to get the helicopter to land,
but stay in the chopper...
//This part is not relevant to you, but included the entire script above, to give you ideals.
//This code continues to execute, until _Heli distance is less than 150, or equal
? ((!(_Pilot in _Heli))||(!(alive _Heli))||(!(alive _Pilot))||(!(canmove _Heli))): goto "Cont";
Hint Format["Dist > 150 ETA %1",_Heli distance W1LZ];
? ((_Heli distance W1LZ) > 150): goto "Restart6";
//...now we want to trick the pilot into thinking he's going to get out
_Heli land "Get Out";
//...at about this time, he's looking for the nearest helipad, which we've provided
//him with, so that he lands exactly where we want him to.
#Restart7
(vehicle _Pilot) flyinheight 15;
(vehicle _Pilot) setspeedmode "LIMITED";
? ((!(_Pilot in _Heli))||(!(alive _Heli))||(!(alive _Pilot))||(!(canmove _Heli))): goto "Cont";
Hint Format["Dist > 25 ETA %1",_Heli distance W1LZ];
? ((_Heli distance W1LZ) > 25): goto "Restart7";
#Restart8
(vehicle _Pilot) flyinheight 15;
(vehicle _Pilot) setspeedmode "LIMITED";
? ((!(_Pilot in _Heli))||(!(alive _Heli))||(!(alive _Pilot))||(!(canmove _Heli))): goto "Cont";
Hint Format["Dist > 15 ETA %1",_Heli distance W1LZ];
? ((_Heli distance W1LZ) > 15): goto "Restart8";
//...at this point the _Heli is so close to the ground that we will
//give him another command to counter the previous order. This will
//keep him in the helicopter.
_Heli land "LAND";
(vehicle _Pilot) flyinheight 0;
//Helicopter has landed, and pilot is still in the pilot's seat.
Hint "Landed!";
goto "ContEnd";