Tankbuster 1747 Posted September 8, 2013 There's an additemcargoglobal command, so I can add FAKs to unit and vehicles, but after an hour of messing with various commands, I think there's no way of removing first aid kits from vehicles. Unless someone knows better. :) Share this post Link to post Share on other sites
kylania 568 Posted September 8, 2013 clearItemCargoGlobal this; Share this post Link to post Share on other sites
Tankbuster 1747 Posted September 8, 2013 Ah well done. Didn't spot that one, thanks, K. :) Share this post Link to post Share on other sites
dave_beastttt 135 Posted September 9, 2019 If you want to remove all items from UAV inventory (First Aid Kits etc), in initPlayerLocal.sqf in mission file add player addEventHandler ["WeaponAssembled", {clearItemCargoGlobal (_this select 1);}]; Then assembling a UAV backpack will spawn the UAV with an empty inventory Share this post Link to post Share on other sites
gokitty1199 225 Posted September 9, 2019 this will get all of the items in the container and the amount of them, then it will loop through the items to find the FAK in the array, then delete it from the array of items, then clear the items from the container and readd all of the items but without the FAK _AllItems = GetItemCargo Container; _Items = (_AllItems Select 0); _Amount = (_AllItems Select 1); _IndexOfFAK = 0; { if (_x == "FirstAidKit") then { _IndexOfFAK = _ForEachIndex; }; } ForEach _Items; _Items DeleteAt _IndexOfFAK; _Amount DeleteAt _IndexOfFAK; ClearItemCargoGlobal Container; { _Item = _x; _Count = (_Amount Select _ForEachIndex); Container AddItemCargoGlobal [_Item, _Count]; } ForEach _Items; Share this post Link to post Share on other sites
Larrow 2827 Posted September 9, 2019 TAG_fnc_removeItemsCargo = { params[ "_container", "_itemsToRemove" ]; _items = itemCargo _container call BIS_fnc_consolidateArray; clearItemCargoGlobal _container; { _x params[ "_item" ]; if ( _itemsToRemove findIf{ _x == _item } isEqualTo -1 ) then { _container addItemCargoGlobal _x; }; }forEach _items; }; [ cursorObject, [ "FirstAidKit" ] ] call TAG_fnc_removeItemsCargo; Share this post Link to post Share on other sites