{"name":"removeWeaponGlobal","operator":null,"title":"removeWeaponGlobal","type":"command","url":"https://community.bistudio.com/wiki/removeWeaponGlobal","revid":373147,"updated":"2025-04-04T06:15:31Z","groups":["Unit Inventory","Vehicle Inventory"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"0.76"}],"since":{"game":"arma3","name":"Arma 3","version":"0.76"},"arma3_since":"0.76","branch":null,"locality":{"argument":"global","effect":"global","server_exec":false},"exec":null,"description":"Remove a weapon from a unit. An attempt to remove a weapon, which is not in unit's possession, is simply ignored.","syntaxes":[{"syntax":"unit removeWeaponGlobal weapon","since":null,"effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":"unit or vehicle","types":["Object"],"since":null,"text":"unit: Object - unit or vehicle"},{"name":"weapon","type":"String","optional":false,"default":null,"description":"weapon class name","types":["String"],"since":null,"text":"weapon: String - weapon class name"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"unit","types":["Object"]},"right":{"text":"weapon","types":["String"]}},{"syntax":"object removeWeaponGlobal [weapon, autoselect]","since":"arma3 2.20","effect":null,"exec":null,"params":[{"name":"object","type":"Object","optional":false,"default":null,"description":"unit or vehicle","types":["Object"],"since":null,"text":"object: Object - unit or vehicle"},{"name":"weapon","type":"String","optional":false,"default":null,"description":"weapon class name","types":["String"],"since":null,"text":"weapon: String - weapon class name"},{"name":"autoselect","type":"String","optional":true,"default":"true","description":"false to abort weapon autoselection when removing primary weapon.","types":["String"],"since":null,"text":"autoselect: String - (Optional, default true) false to abort weapon autoselection when removing primary weapon."}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"object","types":["Object"]},"right":{"text":"[weapon, autoselect]","types":["Array"]}}],"examples":[{"text":"```sqf\n{\n    _x removeWeaponGlobal \"Laserdesignator\";\n} forEach allUnits;\n```","code":["{\n\t_x removeWeaponGlobal \"Laserdesignator\";\n} forEach allUnits;"]},{"text":"```sqf\n{\n    if (typeOf _x == \"O_Heli_Attack_02_black_F\") then {\n        _x removeWeaponGlobal \"rockets_Skyfire\";\n    };\n} forEach vehicles;\n```","code":["{\n\tif (typeOf _x == \"O_Heli_Attack_02_black_F\") then {\n\t\t_x removeWeaponGlobal \"rockets_Skyfire\";\n\t};\n} forEach vehicles;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["addWeaponGlobal","removeWeapon","removeMagazine","removeMagazineGlobal","removeAllWeapons"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Unit Inventory","Command Group: Vehicle Inventory","Introduced with Arma 3 version 0.76","Scripting Commands","Scripting Commands: Global Effect"]}