Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Put it into autoexec.cfg (located in the main folder > config > autoexec.cfg <- open with Notepad or something)
- // Smooth sniper scope zoom with mouse wheel
- autoscopesens 1
- persistidents 0
- const ZOOM_SMOOTH 1 // set to 0 to disable smooth zooming
- const ZOOM_SMOOTH_MILLIS_BETWEEN_CHANGES 15 // milliseconds between scopefov changes for smooth zooming
- const ZOOM_DEFAULT_SCOPEFOV 50 // default scopefov for when you first scope in
- const ZOOM_SCOPEFOV_INCREMENT 10 // change scopefov by this much on every tick of the mouse wheel
- const isany [ bool = 0; looplist $arg2 ia [ if (strcmp $ia $arg1) [ bool = 1; break ] ]; return $bool ]
- const validscopefov [ return (checkrange $arg1 5 60) ]
- const doscope [
- if (! $numargs) [
- scopefov $ZOOM_DEFAULT_SCOPEFOV
- setscope 1
- onrelease [ setscope 0 ]
- ] [
- newfov = -1
- if (isany $arg1 [in 1 +]) [
- oper = -
- newfov = (- $scopefov $ZOOM_SCOPEFOV_INCREMENT)
- dif = (- $scopefov $newfov)
- ] [
- if (isany $arg1 [out 0 -]) [
- oper = +
- newfov = (+ $scopefov $ZOOM_SCOPEFOV_INCREMENT)
- dif = (- $newfov $scopefov)
- ]
- ]
- if (validscopefov $newfov) [
- if $ZOOM_SMOOTH [
- loop sf $dif [
- sleep (* $ZOOM_SMOOTH_MILLIS_BETWEEN_CHANGES $sf) [
- newfov = ($oper $scopefov 1)
- if (validscopefov $newfov) [ scopefov $newfov ]
- ]
- ]
- ] [ scopefov $newfov ]
- ]
- ]
- ]
- altaction_5 = doscope
- delta_game_0 = [
- if (&& (= (curweapon) $SNIPER) (player1 scoping)) [
- if (= $arg1 1) [ doscope + ] [ doscope - ]
- ] [
- if (= $arg1 1) [ shiftweapon 1 ] [ shiftweapon -1 ]
- ]
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement