{"name":"removeWeaponGlobal","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","games":{"arma3":"0.76"},"since":"arma3 0.76","arma3_since":"0.76","locality":{"argument":"global","effect":"global"},"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","params":[{"name":"unit","type":"Object","description":"unit or vehicle","type_expr":"Object"},{"name":"weapon","type":"String","description":"weapon class name","type_expr":"String"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"unit"},"right":{"text":"weapon"}},{"syntax":"object removeWeaponGlobal [weapon, autoselect]","since":"arma3 2.20","params":[{"name":"object","type":"Object","description":"unit or vehicle","type_expr":"Object"},{"name":"weapon","type":"String","description":"weapon class name","type_expr":"String"},{"name":"autoselect","type":"String","optional":true,"default":"true","description":"false to abort weapon autoselection when removing primary weapon.","type_expr":"String","text":"autoselect: String - (Optional, default true) false to abort weapon autoselection when removing primary weapon."}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"object"},"right":{"text":"[weapon, autoselect]"}}],"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;"]}],"see_also":["addWeaponGlobal","removeWeapon","removeMagazine","removeMagazineGlobal","removeAllWeapons"]}