Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private ["_h","_group","_groupUnits","_groupLeader","_aliveUnits","_inHelo","_M"];
- _h = h1;
- _group = aa1;
- _groupLeader = leader _group;
- _groupUnits = count units _group;
- _aliveUnits = {alive _x} count units _group;
- _inHelo = false;
- finishedmission = 0;
- pad = "Land_HelipadEmpty_F" createVehicle [3148.06,11624.7,0];
- _M = [west,["task2"],["We noticied a lot of enemy movement, we need to reforce our positions. Transport this Anti Air team to the designated position.",
- "Transport AA team",""],pad,true,3,true] call BIS_fnc_taskCreate;
- sleep 2;
- {_x assignAsCargo _h;_x enableAI "Move";_x setUnitPos "UP";_x setBehaviour "SAFE";_x setSpeedMode "FULL"}
- forEach units _group;
- _wp = _group addWaypoint [position _h, 0];
- _wp setWaypointType "GETIN";
- while {finishedmission == 0} do
- {
- _aliveUnits = {alive _x} count units _group;
- if ({_x in _h} count units _group == _groupUnits AND !_inHelo) then
- {
- _groupLeader sideChat "All in, we are ready to go.";
- _inHelo = true;
- } else
- { if ({_x in _h} count units _group == 0 AND _inHelo) then
- {
- _groupLeader sideChat "We are off, you are clear to go.";
- _inHelo = false;
- };
- };
- if ((player distance pad) < 50 AND (((getPosATL _h) select 2) < 5) AND speed _h < 5) then
- {
- {unassignVehicle _x; _x action['EJECT', vehicle _h]} forEach units _group;
- };
- if (!alive player OR _aliveUnits < _groupUnits) then
- {
- _M = ["task2", "FAILED"] spawn BIS_fnc_taskSetState;
- finishedmission = 1;
- };
- if ((player distance pad) < 30 AND (_aliveUnits == _groupUnits) AND ({_x in _h} count units _group == 0))
- then
- {
- _M = ["task2", "SUCCEEDED"] spawn BIS_fnc_taskSetState;
- finishedmission = 1;
- };
- sleep 1;
- if (finishedmission == 1) then
- {
- deleteVehicle pad;
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement