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



Introduced in

Version:2.11

Description

Description:Returns the weight of the unit weapon.

Syntax

Syntax:unit getWeaponWeight type
Parameters:
  • unit: Object - The unit.
  • type: String - The type of weapon to inquire about. Can be:
  • "PRIMARY"
  • "SECONDARY"
  • "HANDGUN"
  • "BINOCULAR"
Return Value:

Number - Weapon weight (in kg), as defined in the weight parameter in class CfgWeapons:

  • If the unit has more weapons of the specified type, the command returns the weight of the first weapon of this type.
  • Returns nil, if the unit does not have any weapon of the specified type.

Examples

Examples:
_weight = player getWeaponWeight "primary"; // might return 12.9

Additional Information

See also: weightOf, getWeaponName
Multiplayer:
Problems:

Notes