{"name":"BIS_fnc_invAdd","operator":null,"title":"BIS fnc invAdd","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_invAdd","revid":349427,"updated":"2023-11-08T16:27:33Z","groups":["Inventory"],"status":"ok","replaced_by":[],"games":[{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2","name":"Arma 2","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Adds item to inventory - checks if there is room for it. Checks if add was done by engine.","syntaxes":[{"syntax":"[object,class,force] call BIS_fnc_invAdd","since":null,"effect":null,"exec":null,"params":[{"name":"object","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"object: Object"},{"name":"class","type":"String","optional":false,"default":null,"description":"item class to be added","types":["String"],"since":null,"text":"class: String - item class to be added"},{"name":"force","type":"Boolean","optional":true,"default":"false","description":"true to force add item, other items might be removed","types":["Boolean"],"since":null,"text":"force: Boolean - (Optional, default false) true to force add item, other items might be removed"}],"returns":{"type":"Boolean or Array","types":["Boolean","Array"],"description":"true when successfull, Array if force is set to true and items were removed (retuns items)","text":"Boolean or Array - true when successfull, Array if force is set to true and items were removed (retuns items)"}}],"examples":[{"text":"```sqf\n[player,\"someClass\"] call BIS_fnc_invAdd;\n```","code":["[player,\"someClass\"] call BIS_fnc_invAdd;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["BIS_fnc_invRemove","BIS_fnc_invCodeToArray","BIS_fnc_invString","BIS_fnc_invSlots","BIS_fnc_invSlotsEmpty","BIS_fnc_invSlotType"],"notes":[],"categories":["Arma 2: Functions","Arma 2: New Functions","Arma 2: Operation Arrowhead: Functions","Arma 3: Functions","Function Group: Inventory","Functions","Introduced with Arma 2 version 1.00","Take On Helicopters: Functions"],"docblock":null,"filled_from_docblock":[]}