[Help]Count Backpack Items

SchwEde

OpenDayZ Rockstar!
Hey guys,

i want to check the backpack inventory if it has items in it.
Problem so far that i have is that its always saying me its bigger then 0
here is the code i'm using:
Code:
_backpackWpn = getWeaponCargo unitBackpack player;
_backpackMag = getMagazineCargo unitBackpack player;
clearWeaponCargoGlobal unitBackpack player;
clearMagazineCargoGlobal unitBackpack player;

if (count _backpackMag < 0) exitWith {systemChat ('kleiner null');};
if (count _backpackMag == 0) exitWith {systemChat ('muss null sein');};
if (count _backpackMag > 0) exitWith {systemChat ('groesser null');};

Hope someone can help me out here :)

Thanks and cheers
 
This is because it returns nested arrays.
[[magazine],[amount]]

Code:
if (count (_backpackMag select 0) < 0) exitWith {hint "<0"};
if (count (_backpackMag select 0) == 0) exitWith {hint "0"};
if (count (_backpackMag select 0) > 0) exitWith {hint ">0"};
 
Back
Top