-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathinitPlayerLocal.sqf
91 lines (65 loc) · 2.29 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
waitUntil {
if (localNamespace getVariable ["KISKA_missionParams_preloadFinished",false]) exitWith {true};
sleep 0.1;
false
};
waitUntil {
if (missionNamespace getVariable ["BLWK_serverGlobalsInitialized",false]) exitWith {true};
sleep 0.1;
false
};
// if you are a client and not a mission host, you now prep your globals
if (!isServer) then {
call BLWK_fnc_prepareGlobals;
};
// headless client only needs BLWK_fnc_prepareGlobals
if (!hasInterface) exitWith {};
waitUntil {
if !(isNull player) exitWith {true};
sleep 0.1;
false
};
private _player = player;
[_player,false] call BLWK_fnc_allowDamage;
// Lower recoil, lower sway, remove stamina on respawn, make medic and engineer
[_player] call BLWK_fnc_adjustPlayerTraits;
//setup Kill Points
missionNamespace setVariable ["BLWK_playerKillPoints",BLWK_startingKillPoints];
// adds starter items if selected (map, NVGs, pistol, etc.)
waitUntil {
sleep 0.1;
!isNil "BLWK_uniformClass";
};
[_player] call BLWK_fnc_addPlayerItems;
[_player] call BLWK_fnc_addDiaryEntries;
[_player] call BLWK_fnc_addACESupportMenuAction;
[] spawn BLWK_fnc_handleUnconsciousAiEvent;
// vanilla mag repack
if (BLWK_magRepackEnabled) then {
waituntil {!isNull (findDisplay 46)};
(findDisplay 46) displayAddEventHandler ["KeyDown",{
// passes the pressed key and whether or not a ctrl key is down. The proper combo is ctrl+R
if ((_this select 1) isEqualTo 19 AND {_this select 3}) exitWith {
[player,true] call BLWK_fnc_doMagRepack;
};
}];
};
// wait till the play area is defined
waitUntil {!isNil "BLWK_playAreaCenter" AND {!isNil "BLWK_mainCrate"}};
_player setVehiclePosition [BLWK_mainCrate,[],5,"NONE"];
sleep 0.25;
_player switchMove ""; // set player standing
// a loop that updates the info panel in the top left (respawn tickets, current wave #, points)
[] spawn BLWK_fnc_infoPanelLoop;
// for preventing damage under certain cirumstances (friendly fire for one)
// also revives the player if they go down with a medkit in inventory
[_player] call BLWK_fnc_addReviveEhs;
[_player] call BLWK_fnc_initDragSystem;
[false] call BLWK_fnc_playAreaEnforcementLoop;
[_player,true] call BLWK_fnc_allowDamage;
waitUntil {
sleep 0.1;
!isNil "BLWK_playerGroup"
};
sleep 1;
[_player] joinSilent BLWK_playerGroup;