Code:
private ["_grp1","_lzloc","_direc","_lz","_gridPos","_grid","_1","_2","_3","_4","_5","_6","_smokeg","_qtyg","_smoker","_qtyr"];
player kbTell [BIS_SSM_HQWEST,"Transport","TransportRequest",["callsign1",{},format["%1-%2-%3",(player getVariable "callsign2") select 0,(player getVariable "callsign2") select 1,(player getVariable "callsign2") select 2],[(player getVariable "callsign") select 0]],["callsign2",{},"",[(player getVariable "callsign") select 1]],["callsign3",{},"",[(player getVariable "callsign") select 2]],true];
BIS_SSM_HQWEST kbTell [player,"Transport","TransportRequest1a",["callsign1",{},format["%1-%2-%3",(player getVariable "callsign2") select 0,(player getVariable "callsign2") select 1,(player getVariable "callsign2") select 2],[(player getVariable "callsign") select 0]],["callsign2",{},"",[(player getVariable "callsign") select 1]],["callsign3",{},"",[(player getVariable "callsign") select 2]],true];
_x=_this select 0;
_y=_this select 1;
_grp1 = group heli_P;
while {count waypoints _grp1 > 0} do {deletewaypoint (waypoints _grp1 select 0)};
heli_P assignAsDriver heli;
heli_G_1 moveInTurret [heli, [0]];
heli_G_2 moveInTurret [heli, [1]];
heli_G_3 moveInTurret [heli, [2]];
g1w0 = _grp1 addWaypoint [heli,0];
g1w0 setWaypointBehaviour "AWARE";
g1w0 setWaypointType "GETIN";
[units _grp1] orderGetIn true;
_lzloc = createMarker ["lzloc", [0,0,0]];
_lzloc setMarkerShape "ICON";
_lzloc setMarkerColor "ColorGreen";
"lzloc" setMarkerType "Empty";
"lzloc" setMarkerPos [_x,_y,0];
_lzloc = getMarkerPos "lzloc";
_gridPos = mapGridPosition _lzloc;
_grid = toarray _gridPos;
g1wp2=_grp1 addWaypoint [_lzloc, 5];
g1wp2 setWaypointType "MOVE";
g1wp2 setWaypointBehaviour "COMBAT";
{_x disableAI "AUTOTARGET"; _x disableAI "TARGET"} foreach units _grp1;
_is8 = count _grid;
_1 = switch (_grid select 0) do {case 48: {"Zero"};case 49: {"One"};case 50: {"Two"};case 51: {"Three"};case 52: {"Four"};case 53: {"Five"};case 54: {"Six"};case 55: {"Seven"};case 56: {"Eight"};case 57: {"Nine"};};
_2 = switch (_grid select 1) do {case 48: {"Zero"};case 49: {"One"};case 50: {"Two"};case 51: {"Three"};case 52: {"Four"};case 53: {"Five"};case 54: {"Six"};case 55: {"Seven"};case 56: {"Eight"};case 57: {"Nine"};};
_3 = switch (_grid select 2) do {case 48: {"Zero"};case 49: {"One"};case 50: {"Two"};case 51: {"Three"};case 52: {"Four"};case 53: {"Five"};case 54: {"Six"};case 55: {"Seven"};case 56: {"Eight"};case 57: {"Nine"};};
_4 = switch (_grid select 3) do {case 48: {"Zero"};case 49: {"One"};case 50: {"Two"};case 51: {"Three"};case 52: {"Four"};case 53: {"Five"};case 54: {"Six"};case 55: {"Seven"};case 56: {"Eight"};case 57: {"Nine"};};
_5 = switch (_grid select 4) do {case 48: {"Zero"};case 49: {"One"};case 50: {"Two"};case 51: {"Three"};case 52: {"Four"};case 53: {"Five"};case 54: {"Six"};case 55: {"Seven"};case 56: {"Eight"};case 57: {"Nine"};};
_6 = switch (_grid select 5) do {case 48: {"Zero"};case 49: {"One"};case 50: {"Two"};case 51: {"Three"};case 52: {"Four"};case 53: {"Five"};case 54: {"Six"};case 55: {"Seven"};case 56: {"Eight"};case 57: {"Nine"};};
if (_is8 == 8) then
{
_7 = switch (_grid select 6) do {case 48: {"Zero"};case 49: {"One"};case 50: {"Two"};case 51: {"Three"};case 52: {"Four"};case 53: {"Five"};case 54: {"Six"};case 55: {"Seven"};case 56: {"Eight"};case 57: {"Nine"};};
_8 = switch (_grid select 7) do {case 48: {"Zero"};case 49: {"One"};case 50: {"Two"};case 51: {"Three"};case 52: {"Four"};case 53: {"Five"};case 54: {"Six"};case 55: {"Seven"};case 56: {"Eight"};case 57: {"Nine"};};
player kbTell [BIS_SSM_HQWEST,"Transport","grid",["location",{},_gridPos,[_1,_2,_3,_4,_5,_6,_7,_8]],true];
BIS_SSM_HQWEST kbTell [player,"Transport","inbound",["location",{},_gridPos,[_1,_2,_3,_4,_5,_6,_7,_8]],true];
} else
{
player kbTell [BIS_SSM_HQWEST,"Transport","grid",["location",{},_gridPos,[_1,_2,_3,_4,_5,_6]],true];
BIS_SSM_HQWEST kbTell [player,"Transport","inbound",["location",{},_gridPos,[_1,_2,_3,_4,_5,_6]],true];
};
waituntil {(Vehicle heli_P) distance _lzloc <= 300};
_type = TGT getVariable "land";
heli_P kbAddtopic["Transport","BIKB.bikb"];
switch (_type) do
{
case "auto":
{
(Vehicle heli_P) land "GET IN";
};
case "smoke":
{
_wait = true;
hint "Throw a GREEN smoke grenade to signal LZ, or a RED to Abort";
heli_P kbTell [player,"Transport","insight"];
while {_wait} do
{
_smokeg = (markerpos "lzloc") nearObjects ["SmokeShellGreen",100];
_qtyg = count _smokeg;
_smoker = (markerpos "lzloc") nearObjects ["SmokeShellRed",100];
_qtyr = count _smoker;
if (_qtyg > 0) then {player execVM "Airfield_Support_Scripts\CHIN\clear.sqf"; _wait = false};
if (_qtyr > 0) then {heli_P exec "Airfield_Support_Scripts\CHIN\abort.sqs"; _wait = false};
};
};
case "strobe":
{
hint "IRStrobe";
_wait = true;
hint "Throw a IR STROBE to signal LZ";
heli_P kbTell [player,"Transport","insight"];
_i=0;
while {_wait AND (_i < 60)} do
{
_strobe = (markerpos "lzloc") nearObjects ["IRStrobe",100];
_qtyg = count _strobe;
if (_qtyg > 0) then {player execVM "Airfield_Support_Scripts\CHIN\clearstrobe.sqf"; _wait = false};
_i = _i + 1;
sleep 1;
};
};
};