getOpticsMode: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "{{RV|type=command |game1= arma3 |branch= dev |version1= 2.10 |gr1= Map |descr= Returns the class name of the current optic mode of the current weapon. |s1= getOpticsMode...")
 
m (Text replacement - "(\|[pr][0-9]+ *= *[^-]+) *- *C([a-eg-z])" to "$1 - c$2")
 
(7 intermediate revisions by 2 users not shown)
Line 2: Line 2:


|game1= arma3
|game1= arma3
|branch= dev
|version1= 2.10
|version1= 2.10


|gr1= Map
|gr1= Object Manipulation


|descr= Returns the class name of the current optic mode of the current weapon.
|descr= Returns the class name of the current optic mode of the current weapon.


|s1= [[getOpticsMode]] unit
|s1= unit [[getOpticsMode]] slot


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


|r1= [[String]] - Slass name of the current optic mode of the current weapon
|p2= slot: [[Number]] - can be one of:
* 0 - [[currentWeapon|Current weapon]]
* 1 - [[primaryWeapon|Primary weapon]]
* 2 - [[secondaryWeapon|Secondary weapon]]
* 3 - [[handgunWeapon|Handgun]]


|x1= <code>[[getObjectID]] player;</code>
|r1= [[String]] - class name of the current optic mode of the current weapon
 
|x1= <sqf>
player getOpticsMode 0; // get current weapon's optic mode
player getOpticsMode 1; // get primary weapon's optic mode
player getOpticsMode 2; // get launcher's optic mode
player getOpticsMode 3; // get handgun's optic mode
</sqf>


|seealso= [[setOpticsMode]]
|seealso= [[setOpticsMode]]
}}
}}

Latest revision as of 14:00, 8 November 2023

Hover & click on the images for description

Description

Description:
Returns the class name of the current optic mode of the current weapon.
Groups:
Object Manipulation

Syntax

Syntax:
unit getOpticsMode slot
Parameters:
unit: Object
slot: Number - can be one of:
Return Value:
String - class name of the current optic mode of the current weapon

Examples

Example 1:
player getOpticsMode 0; // get current weapon's optic mode player getOpticsMode 1; // get primary weapon's optic mode player getOpticsMode 2; // get launcher's optic mode player getOpticsMode 3; // get handgun's optic mode

Additional Information

See also:
setOpticsMode

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