-
Notifications
You must be signed in to change notification settings - Fork 1
/
initPlayerLocal.sqf
executable file
·127 lines (104 loc) · 4.33 KB
/
initPlayerLocal.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
disableRemoteSensors true;
//------------------------------ Headless Client
if !(isServer or hasInterface) then {
if (profileName == "HCAOs") then {
derp_HCAOsConnected = true;
publicVariableServer "HCAOsConnected";
format ["HCAOs connected: %1", derp_HCAOsConnected] remoteExec ["diag_log", 2];
};
} else {//-------------------------------- Player stuff
#include "defines.hpp"
enableSentences false;
[] call derp_fnc_diary; // Diary
[{!isNull (findDisplay 46)}, {call derp_fnc_mapLinesHandler}, []] call derp_fnc_waitUntilAndExecute; // No more penii
["InitializePlayer", [player]] call BIS_fnc_dynamicGroups; // Dynamic groups init
[] execVM "scripts\misc\QS_icons.sqf"; // Map icons
[[player], false] call derp_fnc_remoteAddCuratorEditableObjects; // Add unit to zeus.
//---------------- mission params
if (("staminaEnabled" call BIS_fnc_getParamValue) == 0) then {
player enableStamina false;
};
if (("paraJumpEnabled" call BIS_fnc_getParamValue) == 1) then {
derp_PARAM_paraJumpEnabled = true;
} else {
derp_PARAM_paraJumpEnabled = false;
};
//---------------- class specific stuff
if (player getUnitTrait "derp_pilot") then {
[player, pilotRespawnMarker] call BIS_fnc_addRespawnPosition;
};
// Disable arty computer for non FSG members
if (player getUnitTrait "derp_mortar") then {
enableEngineArtillery true;
} else {
enableEngineArtillery false;
};
if ("derp_revive" in (getMissionConfigValue "respawnTemplates")) then {
if (getMissionConfigValue "derp_revive_everyoneCanRevive" == 0) then {
if (player getUnitTrait "medic") then {
call derp_revive_fnc_drawDowned;
};
} else {
call derp_revive_fnc_drawDowned;
};
call derp_revive_fnc_handleDamage;
call derp_revive_fnc_diaryEntries;
if (getMissionConfigValue "respawnOnStart" == -1) then {[player] call derp_revive_fnc_reviveActions};
};
//---------------- EHs and addactions
player addEventHandler ["GetInMan", {
_this call derp_fnc_pilotCheck;
call derp_fnc_crewNames;
}];
player addEventHandler ["SeatSwitchedMan", {
if !((_this select 3) isKindOf "Air") exitWith {};
_this params ["_unit1", "", "_vehicle"];
private _seat = ((fullCrew _vehicle) select {_x select 0 == _unit1}) select 0;
[(_seat select 0), (_seat select 1), _vehicle, (_seat select 3)] call derp_fnc_pilotCheck;
}];
player addEventHandler ["Fired", {
params ["_unit", "_weapon", "", "", "", "", "_projectile"];
if (_unit distance2D (getMarkerPos "BASE") < 300) then {
deleteVehicle _projectile;
["Don't goof at base", "Hold your horses soldier, don't throw, fire or place anything inside the base."] remoteExecCall ["derp_fnc_hintC", _unit];
}}];
if ("ArsenalFilter" call BIS_fnc_getParamValue == 1) then {
player addEventHandler ["Take", {
params ["_unit", "_container", "_item"];
[_unit, 1, _item, _container] call derp_fnc_gearLimitations;
}];
player addEventHandler ["InventoryClosed", {
params ["_unit"];
[_unit, 0] call derp_fnc_gearLimitations;
}];
};
{
_x addAction [
"<t color='#006bb3'>Save gear</t>",
{
player setVariable ["derp_savedGear", (getUnitLoadout player)];
systemChat "gear saved";
}
];
if (derp_PARAM_paraJumpEnabled) then {
_x addAction [
"<t color='#FF6600'>Paradrop on AO</t>",
{
[player,
2 * ("AOSize" call BIS_fnc_getParamValue)
] call derp_fnc_paradrop;
},
nil,
0,
true,
true,
"",
"(!isNil 'missionInProgress') && {missionInProgress} && {!isNil 'derp_paraPos'}",
5,
false
];
};
} foreach ArsenalBoxes;
};
// Init arsenal boxes, waitAndExec needed for players present at mission start to wait for the server remoteExec
[{[_this select 0, ("ArsenalFilter" call BIS_fnc_getParamValue)] call derp_fnc_VA_filter}, [ArsenalBoxes], 3] call derp_fnc_waitAndExecute;