weapons: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (enhanced category link visibility with capital letters)
m (Text replacement - "\|x([0-9])= *<code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>")
 
(43 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| ofpr |= Game name
|game1= ofp
|version1= 1.75


|1.75|= Game version
|game2= ofpe
____________________________________________________________________________________________
|version2= 1.00


| Returns array of names of all [[Object#Unit|Unit]]'s [[:Category:Weapons|weapons]]. |= Description
|game3= arma1
____________________________________________________________________________________________
|version3= 1.00


| [[Array]] <nowiki>=</nowiki> '''weapons''' vehicleName |= Syntax
|game4= arma2
|version4= 1.00


|p1= vehicleName: [[Object]] |= Parameter 1
|game5= arma2oa
|version5= 1.50


| [[Array]] of weapon names. |= Return value
|game6= tkoh
____________________________________________________________________________________________
|version6= 1.00
 
|x1= <code>_wArray <nowiki>=</nowiki> [[weapons]] [[player]];</code> |= Example 1
____________________________________________________________________________________________


| [[magazines]], [[weaponsTurret]], [[assignedVehicleRole]], [[:Category:Weapons|Link to games Weapons Category]], [[weaponState]] |= See also
|game7= arma3
|version7= 0.50


|gr1= Unit Inventory
|gr2= Vehicle Inventory
|descr= Returns array of names of all unit's weapons.
|s1= [[weapons]] unit
|p1= unit: [[Object]]
|r1= [[Array]] of weapon names.
|x1= <sqf>_wArray = weapons player;</sqf>
|seealso= [[magazines]] [[weaponsTurret]] [[assignedVehicleRole]] [[weaponState]]
}}
}}


<h3 style="display:none">Notes</h3>
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
 
<dd class="notedate">Posted on 12:07, 20 January 2007
<dt></dt>
<dt class="note>'''[[User:Bdfy|Bdfy]]'''<dd class="note">
<dd class="notedate">Posted on 12:07, 20 January 2007</dd>
(A1 1.02) this command returns only weapons defined for the primary turret of the vehicle.  
<dt class="note">[[User:Bdfy|Bdfy]]</dt>
<dd class="note">
{{GVI|arma1|1.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"]
for ex. only ["D81", "PKT"] for t72, not ["D81", "PKT","DSHKM"]
</dd>


<dd class="notedate">Posted on 06:01, 3 March 2007 (CET)
<dt><dt>
<dt class="note>'''[[User:Donnervogel|Donnervogel]]'''<dd class="note">''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.
<dd class="notedate">Posted on 06:01, 3 March 2007 (CET)</dd>
<dt class="note">[[User:Donnervogel|Donnervogel]]</dt>
<dd class="note">''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.
</dd>


<dd class="notedate">Posted on 11 March 2011
<dt><dt>
<dt class="note>'''[[User:kju|kju]]'''
<dd class="notedate">Posted on 11 March 2011</dd>
<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.
 
<dt><dt>
<dd class="notedate">Posted on 25 November 2011
<dd class="notedate">Posted on 25 November 2011</dd>
<dt class="note>'''[[User:Dr_Eyeball|Dr_Eyeball]]'''
<dt class="note">[[User:Dr_Eyeball|Dr_Eyeball]]</dt>
<dd class="note">
<dd class="note">
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.)
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.)
<dd class="notedate">Posted on 18 June 2013
<dt class="note>'''[[User:Druid|Druid]]'''
<dd class="note">
Lists also weapons in inventory from Arma 3 ver. 0.70.
<!-- Note Section END -->
</dl>
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|WEAPONS]]
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.96|WEAPONS]]
[[Category:Scripting Commands ArmA|WEAPONS]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Weapons|{{uc:{{PAGENAME}}}}]]

Latest revision as of 11:25, 13 May 2022

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 weapon 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.)