{"name":"BIS_fnc_addVirtualItemCargo","operator":null,"title":"BIS fnc addVirtualItemCargo","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_addVirtualItemCargo","revid":325299,"updated":"2022-07-10T22:41:08Z","groups":["Inventory"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.24"}],"since":{"game":"arma3","name":"Arma 3","version":"1.24"},"arma3_since":"1.24","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Add virtual items to an object (e.g., ammo box). Virtual items can be selected in the Arsenal.\nIf parameters 4 and 5 are used this function can replace BIS_fnc_addVirtualWeaponCargo, BIS_fnc_addVirtualMagazineCargo and BIS_fnc_addVirtualBackpackCargo.","syntaxes":[{"syntax":"[object, itemClasses, addItemsGlobal, arsenal, mode, itemType] call BIS_fnc_addVirtualItemCargo","since":null,"effect":null,"exec":null,"params":[{"name":"object","type":"Object","optional":false,"default":null,"description":"object to which items will be added","types":["Object"],"since":null,"text":"object: Object - object to which items will be added"},{"name":"itemClasses","type":"Boolean, String or Array of Strings","optional":false,"default":null,"description":"item classes","types":["Boolean","String","Array"],"since":null,"text":"itemClasses: Boolean, String or Array of Strings - item classes"},{"name":"addItemsGlobal","type":"Boolean","optional":true,"default":"false","description":"true to add items globally","types":["Boolean"],"since":null,"text":"addItemsGlobal: Boolean - (Optional, default false) true to add items globally"},{"name":"arsenal","type":"Boolean","optional":true,"default":"true","description":"true to add Arsenal action","types":["Boolean"],"since":null,"text":"arsenal: Boolean - (Optional, default true) true to add Arsenal action"},{"name":"mode","type":"Number","optional":true,"default":"1","description":"defines what the function will do, can be:\n- -1 - remove given items\n-  0 - return current content\n-  1 - add given items","types":["Number"],"since":null,"text":"mode: Number - (Optional, default 1) defines what the function will do, can be:\n- -1 - remove given items\n-  0 - return current content\n-  1 - add given items"},{"name":"itemType","type":"Number","optional":true,"default":"0","description":"define the item type, can be:\n- 0 - items\n- 1 - weapons\n- 2 - magazines\n- 3 - backpacks","types":["Number"],"since":null,"text":"itemType: Number - (Optional, default 0) define the item type, can be:\n- 0 - items\n- 1 - weapons\n- 2 - magazines\n- 3 - backpacks"}],"returns":{"type":"Array of Strings","types":["Array","String"],"description":"all virtual items","text":"Array of Strings - all virtual items"}}],"examples":[{"text":"```sqf\n[BIS_ammoBox, [\"class_1\", \"class_2\"], false, true] call BIS_fnc_addVirtualItemCargo;\n```","code":["[BIS_ammoBox, [\"class_1\", \"class_2\"], false, true] call BIS_fnc_addVirtualItemCargo;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["Arsenal","BIS_fnc_addVirtualBackpackCargo","BIS_fnc_addVirtualMagazineCargo","BIS_fnc_addVirtualWeaponCargo","BIS_fnc_arsenal","BIS_fnc_getVirtualBackpackCargo","BIS_fnc_getVirtualItemCargo","BIS_fnc_getVirtualMagazineCargo","BIS_fnc_getVirtualWeaponCargo","BIS_fnc_removeVirtualBackpackCargo","BIS_fnc_removeVirtualItemCargo","BIS_fnc_removeVirtualMagazineCargo","BIS_fnc_removeVirtualWeaponCargo"],"notes":[{"user":"Kamaradski","date":"2014-10-16T23:55:00Z","text":"In AmmoboxInit mode, for the ammobox to ONLY contain your white-listed items in the ammobox, you should first issue the BIS_fnc_removeVirtualItemCargo command. Otherwise the box will contain non whitelisted clutter.\n\n**Example:**\n\n```sqf\n[\"AmmoboxInit\", [_myBox, true]] call BIS_fnc_arsenal;\n[_myBox, [true], true] call BIS_fnc_removeVirtualItemCargo;\n[_myBox, [\"U_B_CombatUniform_mcam\", \"U_B_CombatUniform_mcam_tshirt\"], true] call BIS_fnc_addVirtualItemCargo;\n```"}],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Inventory","Functions","Introduced with Arma 3 version 1.24"],"docblock":null,"filled_from_docblock":[]}