secondaryWeapon: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<h3 style="display:none">Bottom Section</h3> " to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame( +[0-9])?|Game [Vv]ersion( +[0-9])?|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|MP[Aa]rg|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects...)
Line 1: Line 1:
{{Command|Comments=
{{Command


| ofpr |Game name=
| ofpr


|1.75|Game version=
|1.75


|gr1= Unit Inventory |GROUP1=
|gr1= Unit Inventory


| Returns name of a unit's secondary weapon (empty string if none). |DESCRIPTION=
| Returns name of a unit's secondary weapon (empty string if none).


| [[secondaryWeapon]] unit |SYNTAX=
| [[secondaryWeapon]] unit


|p1= unit: [[Object]] |PARAMETER1=
|p1= unit: [[Object]]


| [[String]] |RETURNVALUE=
| [[String]]
   
   
|x1= <code>[[private]] _secondaryWeapon = [[secondaryWeapon]] [[player]];</code> |EXAMPLE1=
|x1= <code>[[private]] _secondaryWeapon = [[secondaryWeapon]] [[player]];</code>


|x2= <code>[[hint]] [[secondaryWeapon]] [[player]]; {{cc|"launch_NLAW_F"}}</code> |EXAMPLE2=
|x2= <code>[[hint]] [[secondaryWeapon]] [[player]]; {{cc|"launch_NLAW_F"}}</code>


| [[secondaryWeaponMagazine]], [[secondaryWeaponItems]], [[addSecondaryWeaponItem]]
| [[secondaryWeaponMagazine]], [[secondaryWeaponItems]], [[addSecondaryWeaponItem]]
[[primaryWeapon]], [[handgunWeapon]], [[currentWeapon]], [[weapons]] |SEEALSO=
[[primaryWeapon]], [[handgunWeapon]], [[currentWeapon]], [[weapons]]
}}
}}



Revision as of 12:02, 18 January 2021

Hover & click on the images for description

Description

Description:
Returns name of a unit's secondary weapon (empty string if none).
Groups:
Unit Inventory

Syntax

Syntax:
secondaryWeapon unit
Parameters:
unit: Object
Return Value:
String

Examples

Example 1:
private _secondaryWeapon = secondaryWeapon player;
Example 2:
hint secondaryWeapon player; // "launch_NLAW_F"

Additional Information

See also:
secondaryWeaponMagazinesecondaryWeaponItemsaddSecondaryWeaponItem primaryWeaponhandgunWeaponcurrentWeaponweapons

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

Notes

Posted on August 4, 2006 - 10:58
hardrock
Notes from before the conversion: secondaryWeapon tells you what weapon the unit has irrespective of the status of the weapon. For example a unit that has a LAWLauncher on his back will still report a LAWLauncher as its secondary weapon. Use currentWeapon to detect the active weapon.