ScriptName BinocZoomscript;Variablesshort iMouseWheelUpshort iMouseWheelDownshort iMouseBut1short iMouseBut2short iMouseBut3short iMouseBut4short iMouseBut5short iNormalshort bBinequippedshort iZoomvalueshort bInitializefloat fVanityModeWheelMultBackupfloat zoomFac;UserRef is the actor that has the Binocularsref UserRefBegin OnAdd ; Get whomever is holding this object set UserRef to GetContainerEnd;----------UnEquipping the binoculars--------------Begin OnUnequipset bBinequipped to 0;Enable mouse wheel and buttonsEnableKey iMouseBut2EnableKey iMouseBut3 EnableKey iMouseWheelUpEnableKey iMouseWheelDown;Return zoom alue to normal;set iZoomvalue to 75con_SetCameraFOV 90End;----------Equipping the binoculars--------------Begin OnEquipset Bbinequipped to 1;Disable mouse wheel and buttonsDisableKey iMouseBut2Set fVanityModeWheelMultBackup to GetGameSetting fVanityModeWheelMult ;con_SetCameraFOV iZoomvalueEndBegin GameMode;----------Mouse wheel--------------;Initialize variablesif bInitialize !=1Set iMouseWheelUp to 264Set iMouseWheelDown to 265Set iMouseBut1 to 256Set iMouseBut2 to 257Set iMouseBut3 to 258Set iMouseBut4 to 259Set iMouseBut5 to 260set bBinequipped to 0set iZoomvalue to 90Set bInitialize to 1endifIf bBinequipped == 1 If IsKeyPressed2 iMouseBut2 == 1 con_SetCameraFOV iZoomvalue DisableKey iMouseBut3 DisableKey iMouseWheelUp DisableKey iMouseWheelDown ;Disable vanity cam SetNumericGameSetting fVanityModeWheelMult 0.0 ; ***** Mouse Wheel zooms ***** If IsKeyPressed2 iMouseWheelDown == 1 if iZoomvalue < 90 PlaySound BinocZoomOut Set iZoomvalue to iZoomvalue + 5 Endif ElseIf IsKeyPressed2 iMouseWheelUp == 1 if iZoomvalue > 5 PlaySound BinocZoomIn Set iZoomvalue to iZoomvalue - 5 Endif ElseIf IsKeyPressed2 iMouseBut3 == 1 Set zoomFac to 90/iZoomvalue Message " %.2f X", zoomFac,1 EndIf con_SetCameraFOV iZoomvalue else EnableKey iMouseBut3 EnableKey iMouseWheelUp EnableKey iMouseWheelDown ;Enable vanity camera SetNumericGameSetting fVanityModeWheelMult fVanityModeWheelMultBackup con_SetCameraFOV 90 endifendifend
Any help appreciated.