Referencing a vehicles inventory.

Rossymond

Moderator
Staff member
Hi all, pulling my hair out with this one.

so this is used a fair bit

Code:
_blah = count magazines player;

Easy peasy, now where I am struggling is to reference the inventory of an external object, for instance a vehicle thats next to my player.

So far I came up with this

Code:
_nearbench = position player nearObjects ["WorkBench",20];
_targetbench = _nearbench select 0;
InvBench = magazines _targetbench ;
_objWpnTypes = (InvBench select 0);
_objWpnQty = (InvBench select 1);

But then....

Code:
            _qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines _targetchest;
 
or
 
            _qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines _objWpnTypes/_objWpnQty;
 
or
 
            _qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count _targetchest;

Etc etc etc, none of them work. The script either just failed to run, with no errors, or just failed and exits with the standard "fuck you" message :)

Any ideas as to how I would go about this?

Rossy
 
instead of using magazines use these (getMagazineCargo [object], getWeaponCargo [object], getBackpackCargo [object])
 
Back
Top