Page tree
Skip to end of metadata
Go to start of metadata

Introduced in

Version:1.00

Description

Description:

Remove a weapon from a unit or vehicle.

Note: It is possible to create invalid combinations with this command (for example, attempt to remove a weapon that the unit does not possess). In the event of an invalid combination, the command behavior is undefined.

Syntax

Syntax:unit removeWeapon weaponName
Parameters:
  • unit: Object - Unit or vehicle without turrets.
  • weaponName: String - Class name (see Weapon Configuration in the VBS3 Developer Reference) of the weapon.
Return Value:Nothing

Alternative Syntax

Syntax:unit removeWeapon [weaponName, turret] (VBS3 1.60+, not available in VBS3 2.x+, not functional again in VBS3 21.1+ and is ported to VBS4 20.1.2 and VBS4 21.1)
Parameters:
  • unit: Object - Vehicle with turrets.
  • weaponName: String - Class name (see Weapon Configuration in the VBS3 Developer Reference) of the weapon.
  • turret: Array - Turret to remove the weapon from.
Return Value:Nothing

Alternative Syntax #2

Syntax:unit removeWeapon weaponObject (VBS3 3.9+)
Parameters:
  • unit: Object - Vehicle with turrets.
  • weaponObject: Object - Object of the weapon to remove.
Return Value:Nothing

Examples

Examples:player removeWeapon "M16"car removeWeapon ["vbs2_carhorn",[]]

Additional Information

See also: addWeapon, removeAllWeapons, removeMagazines
Multiplayer:
Problems:

Notes