forked from Ansible2/Arma-3-Survival
-
Notifications
You must be signed in to change notification settings - Fork 0
/
onPlayerRespawn.sqf
47 lines (33 loc) · 1.37 KB
/
onPlayerRespawn.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
params ["_player"];
["Terminate"] call BIS_fnc_EGSpectator;
_player setVehiclePosition [BLWK_mainCrate,[],5,"NONE"];
//remove and add gear
if !(BLWK_saveRespawnLoadout) then {
// check if the player should have any default items (per mission params)
// i.e. radio, compass, pistol, etc.
[_player] call BLWK_fnc_addPlayerItems;
} else {
_player setUnitLoadout BLWK_savedLoadout;
};
[_player] call BLWK_fnc_addReviveEhs;
// Lower recoil, lower sway, remove stamina, make medic and engineer
[_player] call BLWK_fnc_adjustPlayerTraits;
[_player] call BLWK_fnc_initDragSystem;
[_player] joinSilent BLWK_playerGroup;
// should be free respawns unless it is during a wave
if !(missionNamespace getVariable ["BLWK_inBetweenWaves",false]) then {
private _remainingTickets = [BLUFOR,-1] call BIS_fnc_respawnTickets;
missionNamespace setVariable ["BLWK_numRespawnTickets",_remainingTickets,true];
};
[false] call BLWK_fnc_reassignCurator;
// handle if someone died while an aircraft gunner
if (missionNamespace getVariable ["BLWK_isAircraftGunner",false]) then {
missionNamespace setVariable ["BLWK_isAircraftGunner",false];
};
// make players briefly invincible
[_player] spawn {
param ["_player"];
private _idOfRespawnInvincibility = [_player,false] call BLWK_fnc_allowDamage;
sleep 15;
[_player,true,_idOfRespawnInvincibility] call BLWK_fnc_allowDamage;
};