removeWeapon: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
Line 12: Line 12:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Remove weapon from a unit. <br>
| Remove weapon from a unit. The unit must be [[local]]. For a global version of this command see [[removeWeaponGlobal]].
 
'''Note''': It is possible to create invalid combinations with this command (ie, attempting to remove a weapon that a unit does not possess). When doing so, application behaviour is undefined. |= Description
'''Note''': It is possible to create invalid combinations with this command (ie, attempting to remove a weapon that a unit does not possess). When doing so, application behaviour is undefined. |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| unitName '''removeWeapon''' weaponName |= Syntax
| unit '''removeWeapon''' weapon |= Syntax


|p1= unitName: [[Object]] |= Parameter 1
|p1= unit: [[Object]] - unit or vehicle |= Parameter 1
|p2= weaponName: [[String]] |= Parameter 2
|p2= weapon: [[String]] - weapon class name |= Parameter 2


| [[Nothing]] |= Return value
| [[Nothing]] |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________
   
   
|x1= <code>[[player]] removeWeapon "M16"</code> |= Example 1
|x1= <code>[[player]] [[removeWeapon]] "BAF_L85A2_RIS_SUSAT";</code> |= Example 1
 
|x2= <code>An_2 [[removeWeapon]] "M240_veh";</code> |= Example 2
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[addWeapon]], [[removeAllWeapons]] |= See also
| [[removeWeaponGlobal]], [[addWeapon]], [[removeAllWeapons]] |= See also


}}
}}

Revision as of 11:36, 7 August 2013

Hover & click on the images for description

Description

Description:
Remove weapon from a unit. The unit must be local. For a global version of this command see removeWeaponGlobal. Note: It is possible to create invalid combinations with this command (ie, attempting to remove a weapon that a unit does not possess). When doing so, application behaviour is undefined.
Groups:
Uncategorised

Syntax

Syntax:
unit removeWeapon weapon
Parameters:
unit: Object - unit or vehicle
weapon: String - weapon class name
Return Value:
Nothing

Examples

Example 1:
player removeWeapon "BAF_L85A2_RIS_SUSAT";
Example 2:
An_2 removeWeapon "M240_veh";

Additional Information

See also:
removeWeaponGlobaladdWeaponremoveAllWeapons

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

  • 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. --zGuba 14:30, 27 May 2009 (CEST)

Bottom Section