-TWC| Forum
Advanced 01 - Two commands under one key 1 - Printable Version

+- -TWC| Forum (https://board.twcclan.org)
+-- Forum: Public (https://board.twcclan.org/forum-13.html)
+--- Forum: Tutorials (https://board.twcclan.org/forum-15.html)
+---- Forum: How to make a cfg? (https://board.twcclan.org/forum-58.html)
+---- Thread: Advanced 01 - Two commands under one key 1 (/thread-26.html)



Advanced 01 - Two commands under one key 1 - John - 21-02-2012

Basic 07 - Comment lines | Advanced 02 - Two commands under one key 2

If you came this far understanding everybit of it you should do a little applause for yourself!

Now lets get serious, I'll teach you how to use put two commands under one key.
The idea is that you can use your ALT key and another key (like F3) to say a different command then with only F3:

autoexec.cfg
Code:
bind F3 "say Hi" bind ALT "+vstr HiTeam HiGlob" set HiGlob "vstr HiGlobSay" set HiTeam "vstr HiTeamSay" set HiGlobSay "bind F3 say Hi" set HiTeamSay "bind F3 say_team Hi"
If you followed my other tutorials you understand most part exept the +vstr:
+vstr is the important thing here, it makes it possible to do 2 commands on 1 key: pressed and released.

If ALT is pressed it will goto HiTeam -> HiTeamSay -> bind F3 say_team Hi
If ALT is released it will goto HiGlob -> HiGlobSay -> bind F3 say Hi

Its a bit hard to explain, I hope you understand it this way!