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



Introduced in

Version:1.45

Description

Description:Disables firing a weapon or turret.

Note: The Weapon Safety Switch has to be activated in the VBS Simulation Settings. Also, the command has no effect on unarmed units (if weapon safety is turned off - see setWeaponSafety - for an unarmed unit, and the unit is then given a weapon, the safety is still turned on).

Syntax

Syntax:unit setWeaponSafety switch
Parameters:
  • unit: Object - Affected unit.
  • switch: Boolean - If true, the unit current weapon cannot be fired, and a Safety On status message is visible in the player HUD. If false, the weapon can be fired normally.
Return Value:Nothing

Alternative Syntax

Syntax:[vehicle, turret] setWeaponSafety switch
Parameters:
  • vehicle: Object - Affected vehicle.
  • turret: Array - All weapons in the selected turret will be switched
  • switch: Boolean - If true, none of the turret weapons can be fired, and a Safety On status message is visible in the player HUD. If false, weapons can be fired normally.
Return Value:Nothing

Examples

Examples:
player setWeaponSafety true;
[someTank,[0]] setWeaponSafety true;

Additional Information

See also: weaponSafety, weaponState, disableWeaponControl
Multiplayer:
Problems:

Notes