I suppose the best way to control the chopper is to use the script which is controlling it from takeoff till landing.
For example, use something like this (group of soldiers is called here "my_group", chopper - "my_chopper"):
enter "[] exec "general.sqs"" into the init string of the chopper.
general.sqs script:
groupIsOnboard = 0
;wait until group is onboard
[my_chopper, my_group] exec "load_group.sqs"
@(groupIsOnboard ==1)
my_chopper flyInHeight 20
my_chopper Move (getPos LandPos)
~3
my_group lockWP true
;Wait until chopper get to the point
@((my_chopper distance (LandPos))<128)
my_chopper flyInHeight 0
my_chopper land "land"
;Wait until landing
@(((getPos my_chopper) select 2) < 1)
(commander my_chopper) action ["ENGINEOFF"]
my_group lockWP false
[my_group] exec "eject.sqs"
@(groupIsOnboard ==0)
LandPos is a name of invisible (or visible - if you need) helipad on the position of landing.
The script "load_group.sqs" is the following:
_Group = _this select 0
_vehicle = _this select 1
;Assign any alive unit of group as a cargo of a chopper
_limit = count units _Group
_count = 0
#cycle_begin
_unit = (units _Group) select _count
_unit AssignAsCargo _vehicle
_count = _count+1
?(_count < _limit): goto "cycle_begin"
;then order whole group to get in
(units _Group) orderGetIn true
_limit = count units _Group
_count=0
#begin_load
_unit=((units _Group) select _count)
@(_unit IN _vehicle)
_count=_count+1
?(_count < _limit):goto "begin_load"
GroupIsOnboard = 1
exit
And the script "eject.sqs" is the following:
_Group = _this select 0
@(((getPos Heli_1) select 2) < 1)
_limit = count units _Group
_count=0
#begin_unload
_unit=((units _Group) select _count)
unassignVehicle _unit
_unit action ["getout",Heli_1]
#wait_unload
~0.5
? (_unit in Heli_1):goto "wait_unload"
~0.5
_count=_count+1
?(_count < _limit):goto "begin_unload"
GroupIsOnboard = 0
exit
This code is a universal part of my chopper missions and is tested to work correctly.