In order to bind commands, you must have your console enabled.

Options -> Keyboard -> Advanced
Check Enable Console ~

Once you do that, open your console by hitting the "~" key.

Next, we will bind the !dnd command so we don't have to type it every time we want to change our class race. First, select the key you want to use. I use the "-" on my keypad, its close to my mouse and is otherwise useless. The name of this key is kp_minus . So to bind that key to say !dnd we will type this into console:

bind kp_minus "say_team !dnd"

This make you say !dnd in team chat when you press the kp_minus key. We enclose the last bit in quotes because there are multiple parameters to the bind command. Its how the console reads commands.

If you want to learn what the name of a key is, go to your Keyboard options in the CS:S menu. Select an unused command. Change its key to the one you want to use. It will display the name of that key.

It is possible to bind a key to more than one command. For example, if we wanted to say more than one thing at a time, we could do:

bind kp_minus "say_team !dnd; say_team Protect me! I am using the menu!"

The semicolon denotes that you want to run another command.

All spells that are not passive need to be bound to a key. Popular choices for keys include: F Q Z X C V mouse4 mwheelup mwheeldown. To bind a spell, you first select your key and bind it as a command.

bind f !missile

You know have Magic Missile bound to your F key. Whenever you press that key and are hovering your cursor over someone, you will cast Magic Missile on them.

Advanced Binding

Another option we have for multiple commands is using aliases. For example, the bind for healing yourself as a Cleric is:

bind mouse4 "!light self"

An alias is a command that YOU make. We can make an alias that will also heal you, but you only have to bind one command to your button.

alias lightheal "!light self"
bind mouse4 lightheal

The alias "lightheal" now does the same thing as "!light self". We can actually use aliases to do some cool stuff. For example, it is possible to switch spells using aliases.

alias lightheal "!light self; bind mouse4 stuncombo"
alias stuncombo "!stun; bind mouse4 lightheal"
bind mouse4 stuncombo

When you activate the bind by pressing mouse4, the button mouse4 will switch between the two spells every time you press it. Note, you can not always spam spells like this because of spell cooldowns (mostly 1.5s).

Heh, just finishing up writing this I thought of an awesome alias >:D

alias fulllev "!lev3; bind mouse4 nolev"
alias nolev "!lev0; bind mouse4 fulllev"
bind mouse4 fulllev


Levitation may not be included in Python version

Levitation commands work the same way.

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