-
Notifications
You must be signed in to change notification settings - Fork 2
/
initPlayerLocal.sqf
87 lines (72 loc) · 2.85 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
//Post-Init Setup of saved Loadout (Measure taken to help prevent Naked/unarmed People)
// Save Inventory on mission start
[player, [missionNamespace, "Waldo_Player_Inventory"], [], false] call BIS_fnc_saveInventory;
player addAction [
"Flip Vehicle",
"MissionScripts\Logistics\LogiHelpers\flipAction.sqf",
[],
0,
false,
true,
"",
"_this == (vehicle _target) && {(count nearestObjects [_target, ['landVehicle'], 5]) > 0 && {(vectorUp cursorTarget) select 2 < 0}}"
];
/* //This doesnt seem to work after the 2022 December patch.
["CAManBase", "InitPost", {
params ["_unit"];
if (_unit == player) then {
[_unit, [missionNamespace, "Waldo_Player_Inventory"], [], false] call BIS_fnc_saveInventory; // Apparently just doesnt work anymore
//missionNamespace setVariable ["Waldo_Player_Inventory",getUnitLoadout _unit,false]
_unit addAction [
"Flip Vehicle",
"MissionScripts\Logistics\LogiHelpers\flipAction.sqf",
[],
0,
false,
true,
"",
"_this == (vehicle _target) && {(count nearestObjects [_target, ['landVehicle'], 5]) > 0 && {(vectorUp cursorTarget) select 2 < 0}}"
];
};
}] call CBA_fnc_addClassEventHandler;*/
//Respawn Reapplication Of Loadout Segment
["CAManBase", "Respawn", {
params ["_unit"];
if (_unit == player) then {
[_unit, [missionNamespace, "Waldo_Player_Inventory"]] call BIS_fnc_loadInventory;
//_unit setUnitLoadout (missionNamespace getVariable "Waldo_Player_Inventory");
// Respawn Text
[] spawn Waldo_fnc_RespawnText;
player addAction [
"Flip Vehicle",
"MissionScripts\Logistics\LogiHelpers\flipAction.sqf",
[],
0,
false,
true,
"",
"_this == (vehicle _target) && {(count nearestObjects [_target, ['landVehicle'], 5]) > 0 && {(vectorUp cursorTarget) select 2 < 0}}"
];
};
}] call CBA_fnc_addClassEventHandler;
/*
=====================ACE 3 SAVE LOADOUT ON ARSENAL CLOSE====================================
This allows you to save whatever loadout the player selected after they close the arsenal
so that they may respawn with it. Particularly helpful when you just want the player to
select a loadout and then forget about having to use the arsenal after respawning.
*/
// ["ace_arsenal_displayClosed", {
// [player, [missionNamespace, "Waldo_Player_Inventory"]] call BIS_fnc_saveInventory;
// }] call CBA_fnc_addEventHandler;
/*
=====================RESPAWN WITH LOADOUT ON DEATH====================================
UNCOMMENT THE BELOW IF YOU WANT PEOPLE TO RESPAWN WITH WHAT THEY DIED WITH!
*/
/*
["CAManBase", "Killed", {
params ["_unit"];
if (_unit == player) then {
[_unit, [player, "Waldo_Player_Inventory"]] call BIS_fnc_saveInventory;
};
}] call CBA_fnc_addClassEventHandler;
*/