{"name":"removeWeapon","title":"removeWeapon","type":"command","url":"https://community.bistudio.com/wiki/removeWeapon","revid":376459,"updated":"2025-10-14T22:27:24Z","groups":["Unit Inventory","Vehicle Inventory"],"status":"ok","games":{"ofp":"1.00","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.00","arma3_since":"0.50","locality":{"argument":"local","effect":"global"},"description":"Remove weapon from a unit. The unit must be local to the computer where command is executed.\nFor a global version of this command, see removeWeaponGlobal.\n\n> [!NOTE]\n> It is possible to create invalid combinations with this command (e.g attempting to remove a weapon that a unit does not possess).\n> When doing so, application behaviour is undefined.","syntaxes":[{"syntax":"unit removeWeapon 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 removeWeapon [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":[{"code":["player removeWeapon \"BAF_L85A2_RIS_SUSAT\";"]},{"code":["An_2 removeWeapon \"M240_veh\";"]}],"see_also":["removeWeaponGlobal","addWeapon","removeAllWeapons"],"notes":[{"user":"zGuba","date":"2009-05-27T14:30:00Z","text":"CTD may occur in certain conditions: when shooter is AI and is currently shooting at target in some proximity (tested with M136 on ACE 1.08 and Compact Fix 1.14H+). Even \"dropweapon\" action may cause CTD with AI."}]}