arma3_missions/helotraining_rewrite.Altis/ejectSquad.sqf

30 lines
881 B
Plaintext
Raw Normal View History

diag_log format["ejectSquad called, _this: %1", _this];
2016-07-24 21:29:19 +00:00
private _lz = _this select 0;
private _vehicle = _this select 1;
private _squad = _this select 2;
private _fromTaskId = _this select 3;
deleteWaypoint [_squad,1];
{_x action["eject", vehicle _x]} forEach units _squad;
{unAssignVehicle _x} forEach units _squad;
{_x enableAI "TARGET"; _x enableAI "AUTOTARGET";} foreach units _squad;
2016-07-24 21:29:19 +00:00
private _wp = _squad addwaypoint [_lz,5,1];
_wp setwaypointType "MOVE";
scopeName "main";
while {true} do
{
scopeName "ejectloop";
2016-07-25 00:36:48 +00:00
diag_log format["ejectSquad: ticking %1", _this];
if (({(_x in _vehicle) && (alive _x)} count units _squad) == 0) then
{
// No squad units left alive inside
[_fromTaskId, "SUCCEEDED" ,true] spawn BIS_fnc_taskSetState;
breakOut "ejectloop";
};
sleep 2;
};
diag_log format["ejectSquad done, _this: %1", _this];