{"name":"unassignItem","operator":null,"title":"unassignItem","type":"command","url":"https://community.bistudio.com/wiki/unassignItem","revid":353052,"updated":"2024-03-12T12:31:28Z","groups":["Unit Inventory"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma3","name":"Arma 3","version":"0.50"},"arma3_since":"0.50","branch":null,"locality":{"argument":"global","effect":"global","server_exec":false},"exec":null,"description":"Unassigns existing item and tries to put it into inventory. If there is no space in inventory the item simply disappears. See also unlinkItem.","syntaxes":[{"syntax":"unit unassignItem item","since":null,"effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"unit: Object"},{"name":"item","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"item: String"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"unit","types":["Object"]},"right":{"text":"item","types":["String"]}}],"examples":[{"text":"```sqf\n_bluforUnit unassignItem \"NVGoggles\";\n_bluforUnit removeItem \"NVGoggles\";\n_opforUnit unassignItem \"NVGoggles_OPFOR\";\n_opforUnit removeItem \"NVGoggles_OPFOR\";\n_independentUnit unassignItem \"NVGoggles_INDEP\";\n_independentUnit removeItem \"NVGoggles_INDEP\";\n```","code":["_bluforUnit unassignItem \"NVGoggles\";\n_bluforUnit removeItem \"NVGoggles\";\n_opforUnit unassignItem \"NVGoggles_OPFOR\";\n_opforUnit removeItem \"NVGoggles_OPFOR\";\n_independentUnit unassignItem \"NVGoggles_INDEP\";\n_independentUnit removeItem \"NVGoggles_INDEP\";"]},{"text":"```sqf\n{\n    _x unassignItem hmd _x; // unassign (not remove) NVGs from all units\n} forEach allUnits;\n```","code":["{\n\t_x unassignItem hmd _x; // unassign (not remove) NVGs from all units\n} forEach allUnits;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["assignItem","addItem","removeItem","linkItem","unlinkItem","assignedItems","removeAllAssignedItems"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Unit Inventory","Introduced with Arma 3 version 0.50","Scripting Commands","Scripting Commands: Global Effect"]}