Zooming

Zooming

Using Mousewheel

Basically what we do is set up each FOV in an alias. Then we have to tell it where it is going to go from there, and we should let us know where it is.

alias zoom20 "fov 20;echo 20;alias zoomin zoom90;alias zoomout zoom50"
alias zoom50 "fov 50;echo 50;alias zoomin zoom20;alias zoomout zoom80"
alias zoom80 "fov 80;echo 80;alias zoomin zoom50;alias zoomout zoom90"
alias zoom90 "fov 90;echo 90;alias zoomin zoom80;alias zoomout zoom20"

From here we can go two ways. As you can see, it's pretty obvious we need to bind something to both zoomin and zoomout, and it might be an idea to bind something to zoom90 in case we start to feel the effects of a hyperblaster. So:

bind MWHEELUP zoomin
bind MWHEELDOWN zoomout
bind MOUSE3 zoom90

Then we have to define zoomin and zoomout. So, cue cunning trick; call zoom90. So the full thing looks like:

alias zoom20 "fov 20;echo 20;alias zoomin zoom90;alias zoomout zoom50"
alias zoom50 "fov 50;echo 50;alias zoomin zoom20;alias zoomout zoom80"
alias zoom80 "fov 80;echo 80;alias zoomin zoom50;alias zoomout zoom90"
alias zoom90 "fov 90;echo 90;alias zoomin zoom80;alias zoomout zoom20"
zoom90
bind MWHEELUP zoomin
bind MWHEELDOWN zoomout
bind MOUSE3 zoom90

This can then be modified so that you have all FOVs between 10 and 90 mapped, it changes the crosshair when it zooms in etc.

Using one button

The other way is one key zooms in. Let go, it zooms out again.
This is obviously not only useful in this situation. You could modify the intellimouse function so that when you hold down MOUSE3 and scroll, it changes weapon, let go, it sets FOV 90.
Anyway, here is how we do it for the zoom:

alias +zoom "fov 20"
alias -zoom "fov 90"
bind E +zoom

Sweet and simple. If you bind something to an alias which has a '+' prefix, the corresponding alias with a '-' prefix will be executed when the key is released.
Trust me - you'll use this one a lot.

Taken from here

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License