-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitPlayerLocal.sqf
190 lines (153 loc) · 5.92 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
enableSaving [false, false];
enableEngineArtillery false;
["InitializePlayer", [player, true]] call BIS_fnc_dynamicGroups;
player addEventHandler ["HandleRating",{0}];
/*player addEventHandler ["Take",{_this call uo_common_fnc_handleTakeRadio}];*/
/*player addEventHandler ["Take",{_this call uo_common_fnc_handleScopeChange}];*/
// raise radio range as we have only sw
player setVariable ["tf_receivingDistanceMultiplicator", 1];
player setVariable ["tf_sendingDistanceMultiplicator", 1];
if ((side player) == civilian) then {
[{
time > 3
},{
// SACK OWNER action, drops marker instantly but spawns some packages
// not exactly sure why this needs to be delayed, probably some init fuckup
private _sackActionId = player addAction [
"<t color='#FF0000'>Spawn gifts + broadcast position</t>",
"functions\courierTasks\fn_tauntPosition.sqf",
nil,
0,
false,
true,
"",
"(_this) getVariable ['mitm_briefcase_hasBriefcase',false]"
];
[{
params ["_args", "_handle"];
_args params ["_sackActionId"];
diag_log format ["sackActionId: %1", _sackActionId];
private _coolDownValue = player getVariable ["tauntCooldownValue", -1];
private _textCooldown = format ["Cooldown... %1 s", _coolDownValue];
private _defaultText = "Spawn gifts + broadcast position";
private _coolDown = if (_coolDownValue == -1) then {
player setUserActionText [_sackActionId, _defaultText];
} else {
player setUserActionText [_sackActionId, _textCooldown];
};
if (!alive player) exitWith {
[_handle] call CBA_fnc_removePerFrameHandler;
};
}, 0.5, [_sackActionId]] call CBA_fnc_addPerFrameHandler;
},[]] call CBA_fnc_waitUntilAndExecute;
};
// CUSTOM ANIMATIONS
if ((side player) == east) then {
player addAction [
"<t color='#FF0000'>cheeki breeki iv damke</t>",
"functions\common\fn_animSquat.sqf",
nil,
0,
false,
true,
"",
"(vehicle _this == _this) && !(_this getVariable ['mitm_animationRunning', false]) && speed _this < 1 && stance player == 'stand'"
];
};
if ((side player) == west) then {
player addAction [
"<t color='#FF0000'>relax</t>",
"functions\common\fn_animRelax.sqf",
nil,
0,
false,
true,
"",
"(vehicle _this == _this) && !(_this getVariable ['mitm_animationRunning', false]) && speed _this < 1 && stance player == 'stand'"
];
};
if ((side player) == independent) then {
player addAction [
"<t color='#FF0000'>dance</t>",
"functions\common\fn_animDance.sqf",
nil,
0,
false,
true,
"",
"(vehicle _this == _this) && !(_this getVariable ['mitm_animationRunning', false]) && speed _this < 1 && stance player == 'stand'"
];
};
if ((side player) == civilian) then {
player addAction [
"<t color='#FF0000'>dance</t>",
"functions\common\fn_animDance2.sqf",
nil,
0,
false,
true,
"",
"(vehicle _this == _this) && !(_this getVariable ['mitm_animationRunning', false]) && speed _this < 1 && stance player == 'stand'"
];
};
player addMPEventHandler ["MPHit", {
params ["_unit", "_causedBy", "_damage", "_instigator"];
if (animationState _unit == toLower "Acts_Executioner_Squat") then {
[_unit, ""] remoteExec ["switchMove", 0];
_unit setVariable ["mitm_animationRunning", false, true];
};
if (animationState _unit == toLower "Acts_Ambient_Relax_4") then {
[_unit, ""] remoteExec ["switchMove", 0];
_unit setVariable ["mitm_animationRunning", false, true];
};
if (animationState _unit == toLower "Acts_Dance_01") then {
[_unit, ""] remoteExec ["switchMove", 0];
_unit setVariable ["mitm_animationRunning", false, true];
};
if (animationState _unit == toLower "Acts_Dance_02") then {
[_unit, ""] remoteExec ["switchMove", 0];
_unit setVariable ["mitm_animationRunning", false, true];
};
}];
player addEventHandler ["AnimDone", {
params ["_unit", "_anim"];
// hint str _anim;
if (_anim == toLower "Acts_Executioner_Squat") then {
[_unit] remoteExec ["mitm_common_fnc_animSquatEnd", 0];
};
if (_anim == toLower "Acts_Executioner_Squat_End") then {
[_unit, ""] remoteExec ["switchMove", 0];
};
if (_anim == toLower "Acts_Ambient_Relax_4") then {
_unit setVariable ["mitm_animationRunning", false];
};
if (_anim == toLower "Acts_Dance_01") then {
_unit setVariable ["mitm_animationRunning", false];
[_unit, ""] remoteExec ["switchMove", 0];
};
if (_anim == toLower "Acts_Dance_02") then {
_unit setVariable ["mitm_animationRunning", false];
[_unit, ""] remoteExec ["switchMove", 0];
};
}];
[{
!(isNull (findDisplay 46))
},{
(findDisplay 46) displayAddEventHandler ["KeyDown", {
params ["", "_keycode"];
if (_keycode in [17,30,31,32]) then {
if (animationState player in [toLower "Acts_Executioner_Squat"]) then {
[player] remoteExec ["mitm_common_fnc_animSquatEnd", 0];
};
if (animationState player in [toLower "Acts_Ambient_Relax_4"]) then {
[player] remoteExec ["mitm_common_fnc_animRelaxEnd", 0];
};
if (animationState player in [toLower "Acts_Dance_01"]) then {
[player] remoteExec ["mitm_common_fnc_animDanceEnd", 0];
};
if (animationState player in [toLower "Acts_Dance_02"]) then {
[player] remoteExec ["mitm_common_fnc_animDanceEnd", 0];
};
};
}];
}] call CBA_fnc_waitUntilAndExecute;