Upvote Upvoted 0 Downvote Downvoted
Different crosshair when zoomed in?
posted in Customization
1
#1
0 Frags +

Hello, does anyone know about a script which lets you switch crosshair when you are zooming in your sniper scope, and switches back to your crosshair when unscopped? Lemme know please

Thanks!

Hello, does anyone know about a script which lets you switch crosshair when you are zooming in your sniper scope, and switches back to your crosshair when unscopped? Lemme know please

Thanks!
2
#2
0 Frags +

bind mouse2 "+attack2; crosshair2; scopedin"
bind mouse1 "+attack; crosshair1"
bind spacebar "+jump; crosshair1"

alias scopedin "bind mouse2; +attack2; crosshair1; scopedout"
alias scopedout "bind mouse2; +attack2; crosshair2; scopedin"

i'd guess something like this would be the easiest?

bind mouse2 "+attack2; crosshair2; scopedin"
bind mouse1 "+attack; crosshair1"
bind spacebar "+jump; crosshair1"

alias scopedin "bind mouse2; +attack2; crosshair1; scopedout"
alias scopedout "bind mouse2; +attack2; crosshair2; scopedin"

i'd guess something like this would be the easiest?
3
#3
1 Frags +

It's hard to get a script for that because scripts only do things when you press keys, and unscoping can happen in a lot of different ways regardless of keybinds. It's also inconsistent to check if you have your primary out, but can be done (the same way a crosshair switcher script works).

Generally speaking though (not including checking for primary):
Sniper.cfg:

alias xhUnscoped "crosshair-settings-here"
alias xhScoped "crosshair-settings-here"
alias scopedToggle "scopedToggleOn"
alias scopedToggleOn "xhScoped; alias scopedToggle scopedToggleOff"
alias scopedToggleOff "xhUnscoped; alias scopedToggle scopedToggleOn"
alias +jumpup "+jump; +moveup"
alias -jumpup "-jump; -moveup"

bind mouse1 "+attack; spec_next; scopedToggleOff"
bind mouse2 "+attack2; spec_prev; scopedToggle"
bind space "+jumpup; spec_mode; scopedToggleOff"

All other class cfg's:

bind mouse1 "+attack"
bind mouse2 "+attack2"
bind space "+jump"

e: ninja'd, but same idea in both, not sure if hamaham's is functional though

It's hard to get a script for that because scripts only do things when you press keys, and unscoping can happen in a lot of different ways regardless of keybinds. It's also inconsistent to check if you have your primary out, but can be done (the same way a crosshair switcher script works).

Generally speaking though (not including checking for primary):
Sniper.cfg:
[code]alias xhUnscoped "crosshair-settings-here"
alias xhScoped "crosshair-settings-here"
alias scopedToggle "scopedToggleOn"
alias scopedToggleOn "xhScoped; alias scopedToggle scopedToggleOff"
alias scopedToggleOff "xhUnscoped; alias scopedToggle scopedToggleOn"
alias +jumpup "+jump; +moveup"
alias -jumpup "-jump; -moveup"

bind mouse1 "+attack; spec_next; scopedToggleOff"
bind mouse2 "+attack2; spec_prev; scopedToggle"
bind space "+jumpup; spec_mode; scopedToggleOff"[/code]

All other class cfg's:
[code]bind mouse1 "+attack"
bind mouse2 "+attack2"
bind space "+jump"[/code]

e: ninja'd, but same idea in both, not sure if hamaham's is functional though
4
#4
0 Frags +

Thanks for the answers guys, I'll try these out

Thanks for the answers guys, I'll try these out
5
#5
0 Frags +

Okay, for some reason the first one crashes my game, and the second one switches to crosshair2 when I zoom in, but immediately switches back to crosshair1, while still scoping, I'm not sure what I'm doing wrong?

Okay, for some reason the first one crashes my game, and the second one switches to crosshair2 when I zoom in, but immediately switches back to crosshair1, while still scoping, I'm not sure what I'm doing wrong?
6
#6
0 Frags +

The first one crashes your game because when the command scopedin is used it then triggers scopedout and that triggers scopedin again and that forms a loop and the game crashes. Some other stuff causes some problems as well though so I'd just create a toggle like JarateKing has so I'll just edit his script(just change xhUnscoped,xhScoped to the values you want like JarateKing has already mentioned):

alias xhUnscoped "cl_crosshair_file crosshair1" 
alias xhScoped "cl_crosshair_file crosshair2"
alias scopedToggle "scopedToggleOn"
alias scopedToggleOn "xhScoped; alias scopedToggle scopedToggleOff"
alias scopedToggleOff "xhUnscoped; alias scopedToggle scopedToggleOn"
alias +attackswitch "scopedToggle;+attack2"
alias -attackswitch "-attack2"

bind mouse1 "+attack; spec_next; scopedToggleOff";
bind mouse2 "+attackswitch";
bind space "+jump; spec_mode; scopedToggleOff";

Anyways the reason why it didn't work before is because if you bind +attack2 to a key and before that you call an alias it basically keeps zooming in and out forever and if you use it after +attack2 the alias behind it triggers twice. That's why he also made a +jumpup command which I didn't use because it doesn't really matter if your crosshair gets changed to the none scoped in version twice or not. If you still wanted to use it it'd look like this:

alias xhUnscoped "cl_crosshair_file crosshair1"
alias xhScoped "cl_crosshair_file crosshair2"
alias scopedToggle "scopedToggleOn"
alias scopedToggleOn "xhScoped; alias scopedToggle scopedToggleOff"
alias scopedToggleOff "xhUnscoped; alias scopedToggle scopedToggleOn"
alias +attackswitch "scopedToggle;+attack2"
alias -attackswitch "-attack2"
alias +jumpup "+jump; +moveup"
alias -jumpup "-jump; -moveup"

bind mouse1 "+attack; spec_next; scopedToggleOff";
bind mouse2 "+attackswitch";
bind space "+jumpup; spec_mode; scopedToggleOff";
The first one crashes your game because when the command scopedin is used it then triggers scopedout and that triggers scopedin again and that forms a loop and the game crashes. Some other stuff causes some problems as well though so I'd just create a toggle like JarateKing has so I'll just edit his script(just change xhUnscoped,xhScoped to the values you want like JarateKing has already mentioned):

[code]alias xhUnscoped "cl_crosshair_file crosshair1"
alias xhScoped "cl_crosshair_file crosshair2"
alias scopedToggle "scopedToggleOn"
alias scopedToggleOn "xhScoped; alias scopedToggle scopedToggleOff"
alias scopedToggleOff "xhUnscoped; alias scopedToggle scopedToggleOn"
alias +attackswitch "scopedToggle;+attack2"
alias -attackswitch "-attack2"


bind mouse1 "+attack; spec_next; scopedToggleOff";
bind mouse2 "+attackswitch";
bind space "+jump; spec_mode; scopedToggleOff";[/code]

Anyways the reason why it didn't work before is because if you bind +attack2 to a key and before that you call an alias it basically keeps zooming in and out forever and if you use it after +attack2 the alias behind it triggers twice. That's why he also made a +jumpup command which I didn't use because it doesn't really matter if your crosshair gets changed to the none scoped in version twice or not. If you still wanted to use it it'd look like this:

[code]alias xhUnscoped "cl_crosshair_file crosshair1"
alias xhScoped "cl_crosshair_file crosshair2"
alias scopedToggle "scopedToggleOn"
alias scopedToggleOn "xhScoped; alias scopedToggle scopedToggleOff"
alias scopedToggleOff "xhUnscoped; alias scopedToggle scopedToggleOn"
alias +attackswitch "scopedToggle;+attack2"
alias -attackswitch "-attack2"
alias +jumpup "+jump; +moveup"
alias -jumpup "-jump; -moveup"


bind mouse1 "+attack; spec_next; scopedToggleOff";
bind mouse2 "+attackswitch";
bind space "+jumpup; spec_mode; scopedToggleOff";[/code]
Please sign in through STEAM to post a comment.