Files
DayZ-Epoch/SQF/dayz_code/compile/player_dumpBackpack.sqf
icomrade e54b9983dd Replace forEach with Count
Use count where you do not need _forEachIndex variable, it's quicker
than forEach.
2014-05-27 15:37:57 -04:00

13 lines
450 B
Plaintext

private ["_weapons","_magazines","_weaponscnt","_magazinescnt","_backpack"];
_backpack = nearestObject [player, "Bag_Base_EP1"];
if (!(isNull _backpack)) then {
if (!local _backpack) then {
_weapons = getWeaponCargo _backpack;
_magazines = getMagazineCargo _backpack;
_weaponscnt = count(_weapons select 0);
_magazinescnt = count(_magazines select 0);
if ((_magazinescnt > 0) ||(_weaponscnt > 0)) then{
hideObject _backpack;
};
};
};