-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitServer.sqf
86 lines (74 loc) · 2.26 KB
/
initServer.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
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
* Filename:
* initServer.sqf
*
* Description:
* Executed only on server when mission is started.
*
* Creation date: 05/04/2021
*
* */
// ====================================================================================
["Initialize", [true]] call BIS_fnc_dynamicGroups;
if (isDedicated) then {
disableRemoteSensors true;
};
[] spawn {
while {true} do {
{
if (!isNull (getAssignedCuratorUnit _x)) then {
_x addCuratorEditableObjects [allUnits + vehicles,true];
};
} count allCurators;
sleep 10;
};
};
// Returns array of dates for given year when moon is at its fullest
fnc_fullMoonDates =
{
private _year = param [0, 2035];
private ["_date", "_phase", "_fullMoonDate"];
private _fullMoonPhase = 1;
private _waxing = false;
private _fullMoonDates = [];
for "_i" from dateToNumber [_year, 1, 1, 0, 0] to dateToNumber [_year, 12, 31, 23, 59] step 1 / 365 do
{
_date = numberToDate [_year, _i];
_phase = moonPhase _date;
call
{
if (_phase > _fullMoonPhase) exitWith
{
_waxing = true;
_fullMoonDate = _date;
};
if (_waxing) exitWith
{
_waxing = false;
_fullMoonDates pushBack _fullMoonDate;
};
};
_fullMoonPhase = _phase;
};
_fullMoonDates;
};
//set random full moon date in year 1944
setDate selectRandom (1944 call fnc_fullMoonDates);
skipTime 8;
0 setOvercast 0.1;
0 setRain 0;
0 setfog 0.01;
forceWeatherChange;
SPE_IFS_CASAvailability_Side = [east, west, independent];
publicVariable "SPE_IFS_CASAvailability_Side";
[] spawn {
waitUntil {!isNil "ALiVE_REQUIRE_INITIALISED" && time > 120};
ALiVE_Helper_opcomEventListener = compile preprocessFileLineNumbers "Scripts\opcomEventListener.sqf";
opcomEventListener = [nil,"create", ["ALiVE_Helper_opcomEventListener"]] call ALiVE_Helper_opcomEventListener;
};
["someId", "onPlayerConnected", {
if (({isPlayer _x} count playableUnits) > 0 || OPCOM_TOGGLE) then { ["ALIVE_MIL_OPCOM"] call ALiVE_fnc_unPauseModule; OPCOM_TOGGLE = false; };
}] call BIS_fnc_addStackedEventHandler;
["someId", "onPlayerDisconnected", {
if ( ({isPlayer _x} count playableUnits) == 0 ) then { ["ALIVE_MIL_OPCOM"] call ALiVE_fnc_pauseModule; OPCOM_TOGGLE = true; };
}] call BIS_fnc_addStackedEventHandler;