Ref:
https://community.bistudio.com/wiki/cameraView
Syntax:
unitName addEventhandler ["switchOptics", { params [_unit,_opticMode(config class or index),_aiming (true/false)] }];
Description:
switchOptics - fires when a player changes opticsMode or begins to aim down sights.
Fires at the start of the aimTransition, faster than cameraView
Reasoning:
Currently the only method of telling if the player is currently aiming down sight is with the script command ‘cameraView’, however cameraView only changes when the transition animation completes (the player raises the weapons sight in line with their eye). With this eventhandler script writers can detect when the player 1) begins to aim down sights and 2) what optics mode they're using or changed to.
Currently the only method to detect the active optics mode is to use a hook in the unitinfo