r/tf2scripthelp • • Feb 08 '14

Issue Need help with a spy sapper script

So I made a script for spy, with a few ideas from stabby's but it doesn't want to work! (off topic: what does reddit mean "flair my post")

bind "2" sapper_mode

//====Aliases====

alias viewmodel_on r_drawviewmodel 1
alias viewmodel_off r_drawviewmodel 0
alias sensitivity_fast sensitivity 5
alias sensitivity_slow sensitivity 1

//====Sapper====

alias sapper_alert say_team ***SAPPPING***                                                      
alias sapper_binds1 bind "mouse1" "+attack;sapper_alert"                                
alias +sapper_binds2 xhair_type_a
alias -sapper_binds2 xhair_type_b                                     				 
alias sapper_mode "slot2;viewmodel_on;sensitivity_fast;sapper_binds1;+sapper_binds2"       

//====Crosshair switcher====

alias xhair_type_a cl_crosshair_file 
alias xhair_type_b cl_crosshair_file

I cannot understand at all what is wrong!

2 Upvotes

3 comments sorted by

View all comments

Show parent comment

1

u/MrJason005 Feb 09 '14 edited Feb 09 '14

Hmm, yes. That is a part of my whole code. I plan to have a knife_mode which binds different commands and an amby_mode which does other commands. My script is still WYI but i was having problems with that specific part, I didn't bind the amby/knife_mode snappets. Here's my script that I wrote so far.

//=============================================================
//============Knife, ambassador and sapper scripts.============
//=============================================================

bind "1" revolver_mode
bind "2" sapper_mode
bind "3" knife_mode

alias viewmodel_on r_drawviewmodel 1         //Turns the viewmodel on or off, depending on the value. 1= on, 0= off
alias viewmodel_off r_drawviewmodel 0        //Turns the viewmodel on or off, depending on the value. 1= on, 0= off
alias sensitivity_fast sensitivity 5         //Change these values to what you like, Meaning change the "sensitivity [VALUE GOES HERE, REMOVE THE BRACKETS]"
alias sensitivity_slow sensitivity 1         //Change these values to what you like, Meaning change the "sensitivity [VALUE GOES HERE, REMOVE THE BRACKETS]"

//====Revolver====

alias revolver_binds1 bind "mouse1" +attack
alias revolver_binds2 
alias revolver_mode "slot1;viewmodel_off;sensitivity_slow;revolver_binds1"

//====Sapper====

alias sapper_alert "say_team ***SAPPING***"
alias +sap_attack  "+attack; sapper_alert; spec_next"
alias -sap_attack   -attack
alias +sapper_mode "slot2; viewmodel_on; xhair_type_a; sensitivity_fast; bind mouse1 +sap_attack" 
alias -sapper_mode xhair_type_b       

//====Knife====

alias knife_binds1 bind "mouse1" +attack
alias +knife_binds2 xhair_type_a
alias -knife_binds2 xhair_type_b
alias knife_mode "slot3;viewmodel_on;sensitivity_fast;knife_binds1"

//====Cloak====



//====Crosshair flasher====

alias xhair_red         "cl_crosshair_red 250;cl_crosshair_blue 0; cl_crosshair_green 0"
alias xhair_blue        "cl_crosshair_red 0;cl_crosshair_blue 250; cl_crosshair_green 0"
alias xhair_green       "cl_crosshair_red 0;cl_crosshair_blue 0; cl_crosshair_green 250"
alias xhair_magenta     "cl_crosshair_red 250;cl_crosshair_blue 250;cl_crosshair_green 0"

bind "w" "+forward;xhair_red"
bind "s" "+back;xhair_blue"
bind "d" "+moveright;xhair_green"
bind "a" "+moveleft;xhair_magenta"

//====Crosshair switcher====

alias xhair_type_a cl_crosshair_file 5
alias xhair_type_b cl_crosshair_file 2

But a few questions regarding your modifications, does that mean that when i press 2 it attacks automatically and also sends the sap_alert message for as long as I hold 2?

1

u/genemilder Scripter Feb 09 '14

No, that's not what my rewrite does. I made a custom +/- alias (+/-sap_attack) that mouse1 is bound to when you press 2.