-
Notifications
You must be signed in to change notification settings - Fork 0
/
objectiveCompleted.sqf
73 lines (59 loc) · 2.2 KB
/
objectiveCompleted.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#define OBJECTIVE_DELAY 300
private["_unit", "_trigger"];
_unit = (crew (_this select 0)) select 0;
_trigger = _this select 1;
setupFinalObjective = {
if(!isDedicated) then
{
/*if(side group player == west) then
{
_allTasks = simpleTasks player;
{
if(taskState _x == "Created") then
{
_x setTaskState "Canceled";
};
} forEach _allTasks;
};*/
if(side group player == east) then
{
_task = player createSimpleTask ["task_extraction"];
_task setSimpleTaskDescription [format["Reach the LZ and extract (%1 intel needed)", requiredIntel],"Extraction",""];
_task setSimpleTaskDestination (getMarkerPos "extraction_zone");
["TaskAssigned",["","Extraction"]] call BIS_fnc_showNotification;
}
else
{
/*sleep 15;
if(side group player == west) then
{
_task setSimpleTaskDescription ["Reach the LZ and prevent extraction","Stop the extraction",""];
_task setSimpleTaskDestination (getMarkerPos "extraction_zone");
};*/
};
//["TaskAssigned",["","Extraction"]] call BIS_fnc_showNotification;
};
};
if(isServer) then
{
private ["_objectiveScript"];
_objectiveScript = [_this, 2, "objectiveFlag.sqf", [""]] call Bis_fnc_param;
objectivesFinished = objectivesFinished + 1;
publicVariable "objectivesFinished";
[_unit, 1] call Mh_fnc_changeIntelCount;
[[_unit, "Recovered a piece of intel."], "sideChat", side _unit] call BIS_fnc_MP;
if(objectivesFinished == requiredObjectives) then
{
extractionAvailable = true;
publicVariable "extractionAvailable";
sleep 3;
[[], "setupFinalObjective", true, true] call BIS_fnc_MP;
};
if(_objectiveScript != "") then
{
private ["_scriptParams"];
_scriptParams = [_this, 3, [], [ [] ]] call Bis_fnc_param;
sleep OBJECTIVE_DELAY;
[_trigger, _scriptParams] call compile preprocessFileLineNumbers _objectiveScript;
};
};