Difference between revisions of "setOpticsMode"

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "{{RV|type=command |game1= arma3 |branch= dev |version1= 2.10 |gr1= Object Manipulation |descr= Sets the optic mode of the current weapon to the given class name or the inde...")
 
m
Line 14: Line 14:
 
|r1= [[String]] or [[Number]] - Class name defined in the OpticsModes config class of the optic. Or the 0-based order of the optic modes with 0 being the default optic mode.
 
|r1= [[String]] or [[Number]] - Class name defined in the OpticsModes config class of the optic. Or the 0-based order of the optic modes with 0 being the default optic mode.
  
|x1= <code>player setOpticsMode "Hamr2Scope"; // Default optic mode for optic_Hamr</code>
+
|x1= <sqf>player setOpticsMode "Hamr2Scope"; // Default optic mode for optic_Hamr</sqf>
|x2= <code>player setOpticsMode 0;</code>
+
|x2= <sqf>player setOpticsMode 0;</sqf>
 
|seealso= [[getOpticsMode]]
 
|seealso= [[getOpticsMode]]
 
}}
 
}}

Revision as of 11:50, 24 March 2022

Hover & click on the images for description
Only available in Development branch(es) until its release with Arma 3 patch v2.10.

Description

Description:
Sets the optic mode of the current weapon to the given class name or the index. Class name should be defined in the OpticsModes config class of the optic, index is the 0-based order of the optic modes with 0 being the default optic mode.
Groups:
Object Manipulation

Syntax

Syntax:
unit getOpticsMode modeClassNameOrIndex
Parameters:
unit: Object
Return Value:
String or Number - Class name defined in the OpticsModes config class of the optic. Or the 0-based order of the optic modes with 0 being the default optic mode.

Examples

Example 1:
player setOpticsMode "Hamr2Scope"; // Default optic mode for optic_Hamr
Example 2:

Additional Information

See also:
getOpticsMode

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