{"name":"removeWeapon","operator":null,"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","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"local","effect":"global","server_exec":false},"exec":null,"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","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 removeWeapon [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\nplayer removeWeapon \"BAF_L85A2_RIS_SUSAT\";\n```","code":["player removeWeapon \"BAF_L85A2_RIS_SUSAT\";"]},{"text":"```sqf\nAn_2 removeWeapon \"M240_veh\";\n```","code":["An_2 removeWeapon \"M240_veh\";"]}],"multiplayer":null,"problems":null,"aliases":[],"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."}],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Unit Inventory","Command Group: Vehicle Inventory","Introduced with Operation Flashpoint version 1.00","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Scripting Commands: Global Effect","Take On Helicopters: Scripting Commands"]}