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



Introduced in

Version:3.3

Description

Description:Selects the firing mode for the current weapon or a specific turret.

Syntax

Syntax:unit setWeaponMode mode
Parameters:
  • unit: Object - Unit armed with a weapon that allows different firing modes.
  • mode: String - Firing mode to activate (as defined in the weapon modes property - see Weapon Parameters in the VBS3 Developer Reference).
Return Value:Boolean - Returns true, if the selected mode is supported, false if weapon does not have different modes, or the selected mode is not available.

Alternative Syntax

Syntax:vehicle setWeaponMode [turret, mode]
Parameters:
  • vehicle: Object - Vehicle armed with a turret that allows different firing modes.
  • turret: Array - Turret to switch modes.
  • mode: String - Firing mode to activate (as defined in the turret modes property - see Weapon Parameters in the VBS3 Developer Reference).
Return Value:Boolean - Returns true, if the selected mode is supported, false if turret does not have different modes, or the selected mode is not available.

Examples

Examples:
player setWeaponMode "Burst"
tank1 setWeaponMode [[0],"10RndBurst"]

Additional Information

See also: SWITCHWEAPON, selectWeapon, setWeaponBurstTurret, selectWeaponTurret
Multiplayer:
Problems:

Notes