DMS_Exile/@ExileServer/addons/a3_dms/scripts/MissionStatusCheck.sqf
eraser1 74f562de7e Bunch of stuff
Renamed preInit/postInit

All config.sqf options setup and named (for now :P )

Removed "tools" from FillCrate since it was just addItemCargoGlobal as
well

FindSafePos adjustments + renames

IsNearWater function (from WAI)

Add "_markers" array to MissionStatusCheck params (planned implemention:
[_dot,_circle] for the ability to rename a marker after mission
completion. EG: "COMPLETED: Weapons Crate" for X seconds)

Created SelectMagazine fnc

Created files for a couple TODO functions
2015-08-28 03:38:46 -05:00

58 lines
1.6 KiB
Plaintext

/*
[
_position,
[_completionType,_completionArgs],
[_timeStarted,_timeUntilFail],
[_AIUnit1,_AIUnit2,...,_AIUnitX],
[
[_cleanupObj1,_cleanupObj2,...,_cleanupObjX],
[_crate,_vehicle1,_vehicle2,...,_vehicleX]
],
[_msgWIN,_msgLose],
_markers
]
*/
if !(DMS_Mission_Arr isEqualTo []) then {
_index = 0;
{
_index = _index + 1;
call {
if (DMS_DEBUG) then
{
diag_log ("DMS :: Checking Mission Status: "+str _x);
};
_position = _x select 0;
_success = (_x select 1) call DMS_MissionSuccessState;
_timeStarted = _x select 2 select 0;
_timeUntilFail = _x select 2 select 1;
_units = _x select 3;
_buildings = _x select 4 select 0;
_loot = _x select 4 select 1;
_msgSuccess = _x select 5 select 0;
_msgFail = _x select 5 select 1;
_markers = _x select 6;
if (_success) exitWith {
[DMS_CompletedMissionCleanupTime,DMS_CleanUp,(_units+_buildings),false] call ExileServer_system_thread_addTask;
_arr = DMS_Mission_Arr deleteAt _index;
(_loot select 0) call DMS_FillCrate;
_msgSuccess call DMS_BroadcastMissionStatus;
[_markers,"win"] call DMS_RemoveMarkers;
};
if (DMS_MissionTimeoutReset && {[_position,DMS_MissionTimeoutResetRange] call ExileServer_util_position_isPlayerNearby}) exitWith
{
_x set [2,[diag_tickTime,_timeUntilFail]];
};
if ((diag_tickTime-_timeStarted)>_timeUntilFail) exitWith
{
_arr = DMS_Mission_Arr deleteAt _index;
(_units+_buildings+_loot) call DMS_CleanUp;
_msgFail call DMS_BroadcastMissionStatus;
[_markers,"lose"] call DMS_RemoveMarkers;
};
};
false;
} count DMS_Mission_Arr;
};