mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-04 15:22:53 +03:00
Organize files a bit and removed non source pbo's
This commit is contained in:
44
SQF/dayz_code/compile/player_gearSet.sqf
Normal file
44
SQF/dayz_code/compile/player_gearSet.sqf
Normal file
@@ -0,0 +1,44 @@
|
||||
private ["_inventory","_wpns","_mags","_idc","_isOK"];
|
||||
_inventory = _this;
|
||||
if (count _inventory > 0) then {
|
||||
_wpns = _inventory select 0;
|
||||
_mags = _inventory select 1;
|
||||
|
||||
//Add inventory
|
||||
{
|
||||
private["_item","_val"];
|
||||
//is it an array?
|
||||
_idc = 109;
|
||||
if (typeName _x == "ARRAY") then {
|
||||
_item = _x select 0;
|
||||
_val = _x select 1;
|
||||
} else {
|
||||
_item = _x;
|
||||
_val = -1;
|
||||
};
|
||||
|
||||
if (_item == "BoltSteel") then { _item = "WoodenArrow" }; // Convert BoltSteel to WoodenArrow
|
||||
|
||||
//Is item legal?
|
||||
_isOK = isClass(configFile >> "CfgMagazines" >> _item);
|
||||
if (_isOK) then {
|
||||
if (_val != -1) then {
|
||||
player addMagazine [_item,_val];
|
||||
} else {
|
||||
player addMagazine _item;
|
||||
};
|
||||
};
|
||||
_idc = _idc + 1;
|
||||
} forEach _mags;
|
||||
|
||||
//Add weapons
|
||||
{
|
||||
if (_x == "Crossbow") then { _x = "Crossbow_DZ" }; // Convert Crossbow to Crossbow_DZ
|
||||
|
||||
//Is item legal?
|
||||
_isOK = isClass(configFile >> "CfgWeapons" >> _x);
|
||||
if (_isOK) then {
|
||||
player addWeapon _x;
|
||||
};
|
||||
} forEach _wpns;
|
||||
};
|
||||
Reference in New Issue
Block a user