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



Introduced in

Version:1.00

Description

Description: Returns array of names of a unit's or vehicle's weapons (based on CfgWeapons).

Syntax

Syntax: weapons unit
Parameters:
  • unit: Object - Unit or vehicle (if vehicle has multiple turrets, then all are checked)
Return Value: Array of weapons' class names.

Alternative Syntax

Syntax:weapons [vehicle,turret] (V1.60+ or V2.11+)
Parameters:
  • vehicle: Object - Vehicle with turrets
  • turret: Array - Specific turret to check
Return Value:Array of weapons' class names.

Examples

Examples: _weapons = weapons player_weapons = weapons [tank,[0]]

Additional Information

See also: hasWeapon, weaponsTurret, getWeaponObjects
Multiplayer: 
Problems: 

Notes



Posted on 06:01, 3 March 2007 (CET)
Donnervogel
weapons never returns the weapon "Throw" which all soldier units have have to throw handgrenades. You'd have to use hasWeapon to verfy it. Also handgrenades are not listed since they are magazines. Use magazines for that.