r/tf2scripthelp • • Jan 22 '14

Issue Need help with Script and [SM]

bind home playsound
alias playsound playsound1
alias playsound1 "sm_play @all vo/test_two.wav"
alias playsound2 "sm_play @all vo/spy_jaratehit03.wav"
bind shift +toggleState
alias +toggleState "alias playsound playsound2"
alias -toggleState "alias playsound playsound1"

I'm not really sure if you guys will be able to help with this, but I'm trying to create a script that allows multiple binds on one key, so that a different command is executed when Shift is held down. This works in essence, but when using this, SM will read the filepath as "vo\test_two.wav ", and etc, with the extra space on the end, thus rendering the script useless. I don't know why this is happening, any help would be appreciated.

2 Upvotes

5 comments sorted by

View all comments

Show parent comment

1

u/Consceleratus Jan 23 '14

Yeah, I tried that and both worked. I too am assuming this is something on SourceMod's end, but I just wanted to make sure I wasn't doing something incorrectly. Thanks for the relatively quick reply, I'll be looking into some other solutions here.

1

u/clovervidia Batman Jan 23 '14

No problem. I personally have no experience with SourceMod, so I can't offer any other suggestions or workarounds.

If you do find a solution, do come back and update your post if you could.

1

u/genemilder Scripter Jan 23 '14

You can always bind within aliases too, it's just not the best code practice in general. I'd recommend that over making separate cfg files, now that I know that direct binding works.