{"name":"addItem","title":"addItem","type":"command","url":"https://community.bistudio.com/wiki/addItem","revid":369269,"updated":"2024-09-03T18:42:43Z","groups":["Unit Inventory"],"status":"ok","games":{"arma3":"0.50"},"since":"arma3 0.50","arma3_since":"0.50","locality":{"argument":"global","effect":"global"},"description":"Creates new item and tries to add it into inventory. Inventory must have enough space to accomodate new item or command will fail.The item can also be a weapon or a magazine.","syntaxes":[{"syntax":"unit addItem item","params":[{"name":"unit","type":"Object","type_expr":"Object"},{"name":"item","type":"String","type_expr":"String"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"unit"},"right":{"text":"item"}}],"examples":[{"code":["// identical to bluforUnit linkItem \"NVGoggles\"\n// addItem then assignItem makes the item go through through inventory storage and fail if storage space was missing\nbluforUnit addItem \"NVGoggles\";\nbluforUnit assignItem \"NVGoggles\";\n\nopforUnit addItem \"NVGoggles_OPFOR\";\nopforUnit assignItem \"NVGoggles_OPFOR\";\n\nindependentUnit addItem \"NVGoggles_INDEP\";\nindependentUnit assignItem \"NVGoggles_INDEP\";"]}],"see_also":["removeItem","assignItem","unassignItem","assignedItems","linkItem","unlinkItem","removeAllAssignedItems","addItemToUniform","addItemToVest","addItemToBackpack"]}