Difference between revisions of "setOpticsMode"
Jump to navigation
Jump to search
m |
Lou Montana (talk | contribs) m (Add syntax) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
|game1= arma3 | |game1= arma3 | ||
+ | |version1= 2.10 | ||
+ | |||
|branch= dev | |branch= dev | ||
− | |||
|gr1= Object Manipulation | |gr1= Object Manipulation | ||
− | |descr= Sets the optic mode of the current weapon to the given class name or the index. | + | |descr= Sets the optic mode of the current weapon to the given class name or the index. |
− | |s1= unit [[ | + | |
+ | |s1= unit [[setOpticsMode]] mode | ||
|p1= unit: [[Object]] | |p1= unit: [[Object]] | ||
− | |p2= [[String]] or [[ | + | |
+ | |p2= mode: [[String]], [[Number]] or [[Array]]: | ||
+ | * [[String]] - class name defined in the optic's {{hl|OpticsModes}} config class | ||
+ | * [[Number]] - 0-based index of the optic mode with 0 being the default optic mode | ||
+ | * [[Array]] - in format [slotIndex, opticsModeIndexOrClassName] where: | ||
+ | ** slotIndex: [[Number]], can be one of: | ||
+ | *** 0 - Current weapon | ||
+ | *** 1 - Primary weapon | ||
+ | *** 2 - Secondary weapon | ||
+ | *** 3 - Handgun | ||
+ | ** opticsModeIndexOrClassName: [[String]] or [[Number]] as above | ||
|r1= [[Nothing]] | |r1= [[Nothing]] | ||
|x1= <sqf>player setOpticsMode "Hamr2Scope"; // Default optic mode for optic_Hamr</sqf> | |x1= <sqf>player setOpticsMode "Hamr2Scope"; // Default optic mode for optic_Hamr</sqf> | ||
+ | |||
|x2= <sqf>player setOpticsMode 0;</sqf> | |x2= <sqf>player setOpticsMode 0;</sqf> | ||
+ | |||
+ | |x3= <sqf>player setOpticsMode [1, 0]; // reset the optics mode of the player's primary weapon to the default</sqf> | ||
+ | |||
|seealso= [[getOpticsMode]] | |seealso= [[getOpticsMode]] | ||
}} | }} |
Revision as of 15:44, 6 May 2022
Description
- Description:
- Sets the optic mode of the current weapon to the given class name or the index.
- Groups:
- Object Manipulation
Syntax
- Syntax:
- unit setOpticsMode mode
- Parameters:
- unit: Object
- mode: String, Number or Array:
- Return Value:
- Nothing
Examples
- Example 1:
- Example 2:
- Example 3:
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