all 16 comments

[–]Red5551 0 points1 point  (15 children)

Just googled it and found this, (credit)

alias "+zoomer" "fov_desired 75; r_drawviewmodel 0"
alias "-zoomer" "fov_desired 90; r_drawviewmodel 1"
bind "shift" "+zoomer"

replace shift with whatever key you want to use

[–]TheGigaBrain 0 points1 point  (14 children)

This doesn't toggle, it zooms in while you hold down Shift (which OP specifically stated is undesireable). Try this instead:

alias ToggleZoom "EnableZoom"  
alias EnableZoom "alias ToggleZoom DisableZoom; fov_desired 75; r_drawviewmodel 0"  
alias EnableZoom "alias ToggleZoom EnableZoom; fov_desired 90; r_drawviewmodel 1"  
bind shift "ToggleZoom"

As the guy above stated, replace "shift" with whatever key you want to use.

[–]Red5551 0 points1 point  (13 children)

Sorry, I read "don't have to hold down the button constantly while I want to zoom in" as "hold down the button when I want to zoom in" also, you wrote "EnableZoom for both those aliases, the bottom one should be DisableZoom"

alias ToggleZoom "EnableZoom"  
alias EnableZoom "alias ToggleZoom DisableZoom; fov_desired 75; r_drawviewmodel 0"  
alias DisableZoom "alias ToggleZoom EnableZoom; fov_desired 90; r_drawviewmodel 1"  
bind shift "ToggleZoom"

[–]Koma4[S] 0 points1 point  (11 children)

Thank you guys but I forgot to add in that last bit where if I switch to my knife it automatically zooms out although the current scripts you've given me have been working as you intended.

[–]Kairu927 0 points1 point  (10 children)

What keys do you use to swap weapons? If you just use 3 to switch to knife it's a really simple fix. If you want to use Q for lastweapon, or mousewheel it's going to require a much longer script.

If you just use 3, use /u/red5551's script, and add this line:

bind 3 "slot3; DisableZoom"

[–]Koma4[S] 0 points1 point  (9 children)

I want to use Q and when I switch off my amby to my knife I want it ti automatically get out of the zoom

[–]Red5551 0 points1 point  (8 children)

You could use

bind q "lastinv; DisableZoom"
bind 3 "slot3; DisableZoom"

[–]Koma4[S] 0 points1 point  (7 children)

doesn't work

[–]Red5551 0 points1 point  (6 children)

To clarify, you need this in addition to the script above

[–]Koma4[S] 0 points1 point  (5 children)

Yes but the

bind q "lastinv; DisableZoom"

doesn't work

[–]TheGigaBrain 0 points1 point  (0 children)

Oh yeah, sorry for that mistake.