Skip to content

Commit da43c4e

Browse files
CasperentoBoGuu
authored andcommitted
Headgear config for startLoadout (#594)
* Wrong vehicle selling on chopshop FIX * Chopshop cleanup #1 * Chopshop PR requested changes #1 * PR requested changes #1 pt2 * tests fix #1 * PR requested changes pt3 #1 * Slight improvement #1 * Startup loadout enhancement * Few changes...pt1 * old file deleted.. * New headgear config.. Co-authored-by: Ollie W <boguug@gmail.com>
1 parent 7569490 commit da43c4e

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

Altis_Life.Altis/config/Config_Loadouts.hpp

100755100644
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// if you put more than a uniform on the CIV's class, they will be selected randonly,
66
// otherwise, for the other teams, player will get the uniform related to his level
77
8-
itemType[] = { // itemType can be: uniform, vest, backpack, weapon, items or linkedItems
8+
itemType[] = { // itemType can be: uniform, headgear, vest, backpack, weapon, items or linkedItems
99
{ "classname", "conditions" }
1010
};
1111
};
@@ -16,6 +16,9 @@ class Loadouts {
1616
uniform[] = {
1717
{"U_Rangemaster", "call life_copLevel >= 0"}
1818
};
19+
headgear[] = {
20+
{"H_Cap_blk", "call life_copLevel >= 0"}
21+
};
1922
vest[] = {
2023
{"V_Rangemaster_belt", "call life_copLevel >= 0"}
2124
};
@@ -45,6 +48,7 @@ class Loadouts {
4548
{"U_C_Poloshirt_redwhite", "!life_is_arrested"},
4649
{"U_C_Commoner1_1", "!life_is_arrested"}
4750
};
51+
headgear[] = {};
4852
vest[] = {};
4953
backpack[] = {};
5054
weapon[] = {};
@@ -62,6 +66,9 @@ class Loadouts {
6266
uniform[] = {
6367
{"U_Rangemaster", "call life_medicLevel >= 1"}
6468
};
69+
headgear[] = {
70+
{"H_Cap_red", "call life_medicLevel >= 1"}
71+
};
6572
vest[] = {};
6673
backpack[] = {};
6774
weapon[] = {};

Altis_Life.Altis/core/functions/fn_startLoadout.sqf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
Loads a custom loadout on player when he got a new life
88
*/
99
private _pUniform = M_CONFIG(getArray,"Loadouts",str(playerSide),"uniform");
10+
private _pHeadgear = M_CONFIG(getArray,"Loadouts",str(playerSide),"headgear");
1011
private _pVest = M_CONFIG(getArray,"Loadouts",str(playerSide),"vest");
1112
private _pBackpack = M_CONFIG(getArray,"Loadouts",str(playerSide),"backpack");
1213
private _pWeapon = M_CONFIG(getArray,"Loadouts",str(playerSide),"weapon");
@@ -29,6 +30,14 @@ if !(_pUniform isEqualTo []) then {
2930
};
3031
};
3132

33+
if !(_pHeadgear isEqualTo []) then {
34+
_pHeadgear apply {
35+
if (!(_x isEqualTo []) && {!((_x select 0) isEqualTo "") && {([(_x select 1)] call life_fnc_levelCheck)}}) then {
36+
player addHeadgear (_x select 0);
37+
};
38+
};
39+
};
40+
3241
if !(_pVest isEqualTo []) then {
3342
_pVest apply {
3443
if (!(_x isEqualTo []) && {!((_x select 0) isEqualTo "") && {([(_x select 1)] call life_fnc_levelCheck)}}) then {

0 commit comments

Comments
 (0)