weapons: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<dt class="note">\[\[User:([^ ]+)\|([^ ]+)\]\] * *<dd" to "<dt class="note">$2</dt> <dd")
mNo edit summary
 
(6 intermediate revisions by one other user not shown)
Line 32: Line 32:
|p1= unit: [[Object]]
|p1= unit: [[Object]]


|r1= [[Array]] of weapon names.
|r1= [[Array]] of [[String]]s - weapon class names


|x1= <code>_wArray = [[weapons]] [[player]];</code>
|x1= <sqf>_wArray = weapons player;</sqf>


|seealso= [[magazines]], [[weaponsTurret]], [[assignedVehicleRole]] [[weaponState]]
|seealso= [[magazines]] [[weaponsTurret]] [[assignedVehicleRole]] [[weaponState]]
}}
}}


Line 57: Line 57:
<dt><dt>
<dt><dt>
<dd class="notedate">Posted on 11 March 2011</dd>
<dd class="notedate">Posted on 11 March 2011</dd>
<dt class="note">[[User:kju|kju]]</dt>
<dt class="note">[[User:.kju|.kju]]</dt>
<dd class="note">
<dd class="note">
Use [[weaponsTurret]] to determine the weapons of a non gunner/turret position.
Use [[weaponsTurret]] to determine the weapons of a non gunner/turret position.

Latest revision as of 22:03, 26 September 2024

Hover & click on the images for description

Description

Description:
Returns array of names of all unit's weapons.
Groups:
Unit InventoryVehicle Inventory

Syntax

Syntax:
weapons unit
Parameters:
unit: Object
Return Value:
Array of Strings - weapon class names

Examples

Example 1:
_wArray = weapons player;

Additional Information

See also:
magazines weaponsTurret assignedVehicleRole weaponState

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Posted on 12:07, 20 January 2007
Bdfy
Logo A1 black.png1.02 This command returns only weapons defined for the primary turret of the vehicle. for ex. only ["D81", "PKT"] for t72, not ["D81", "PKT","DSHKM"]
Posted on 06:01, 3 March 2007 (CET)
Donnervogel
weapons never returns the weapon "Throw" which all soldier units have have to throw hand grenades. You'd have to use hasWeapon to verify it. Also hand grenades are not listed since they are magazines. Use magazines for that.
Posted on 11 March 2011
.kju
Use weaponsTurret to determine the weapons of a non gunner/turret position.
Posted on 25 November 2011
Dr_Eyeball
This command does not include non-turret weapons, such as smoke, flare or chaff launchers which are usually declared in the root of the vehicle's class, rather than in the Turrets hierarchy. (Unsure whether it excludes it because it is not in the turret or because these are not considered true weapons via some property.)