CS-Nation

Covering the future of Counter-Strike
basic tutorial - intro to aliases
What's an alias?
If you interview every member of the top 10 clans in the world, you'll find that the fair majority of them have one thing in common. They use aliases.

Obviously a few aliases will not make you a great player, but they can and do allow you to coordinate your team, do repetitive things faster, and give you a large edge of speed over a non-alias using player.

In terms of programming each aliases is a function (or subroutine) and a command is the call (or executor).

All aliases have the same basic look:

alias [alias-name] "[command 1]; [command 2]; [command #]...."

An alias names are the exact same thing as a command name, and can be used in other aliases.

What do I need to do first?
There are a few things you should do to start writing aliases:

    » Open up /Half-Life/cstrike/config.cfg with notepad (or any other text editor). Find the line that says
    console "0.000000"
    or something similar. Replace that line with
    console "1"


    » Next, right click on all of your Half-Life/Counter-Strike shortcuts and go down to properties. Select the tab named "Shortcut". Add to the end of the Command Line
    -console -zone 4096 -dev
    The end result should look something like this:
    C:\Sierra\Half-Life\hl.exe -console -zone 4096 -dev
    You'll need to do the same thing for GameSpy by selecting GameSpy -> Games & Filters -> Half-Life -> Command Line. If you don't understand this, go here!

    This will help stop size-related crashes, and print out useful information.


    » If there isn't an autoexec.cfg file in your /cstrike/ directory, create one. Open notepad, Save As, change from *.txt to All Files, name it "autoexec.cfg" with the quotes.

Commands to know
Here are some commands you'll need to remember.

menuselect # - Replace # with a number between 1 and 9 inclusive. This selects the menu item number that you put in for #. For example:

alias joinct "chooseteam; menuselect 2"
This choose the second item, in this case, the Counter-Terrorist Team.

bind KEY COMMAND - This 'binds' a key to a certain command. Remember, you can make the 'COMMAND' be an alias name. Example:

bind "k" "kill"
When you press K you'd kill yourself. If it were
bind "k" "joinct"
Then when you press K you'd join the counter-terrorist team.

exec name.cfg - Executes a cfg file. HL automatically exec's config.cfg and autoexec.cfg.

wait - Pauses and alias for a non-fixed time. The amount of waits needed to clear a menu, for example, varies from computer and connection. Too many waits can lag, too little can have no affect.

Writing and using your first alias
Open up your autoexec.cfg in notepad and type up the following line:
alias hello "say Hello World!; wait; wait; kill; wait; wait; say_team Goodbye World!"
Now, lets explain what everything does:

alias hello
Creates an alias named hello.
"say Hello World!;
The quotation starts the input. The first command is say, which will say anything up to the delimiter, which is the semi-colon (;). In this case, the player would publicly say 'Hello World!'.
wait; wait;
This pauses the script for two ticks (ticks vary from computer speed and internet connection).
kill;
This will make the player commit suicide.
wait; wait;
This pauses the script again for two ticks.
say_team Goodbye World!"
This says to your team (your dead teammates at least) 'Goodbye World!'. You'll notice that " acts as the delimiter, but this is only for the last command in your alias.

Now, save and close the autoexec.cfg and load up Counter-Strike. Either join a public game, or create your own game. In game press the title key (` or ~, above your tab, below your escape key). What comes down is called the console.

If nothing does come down try adding BIND "`" "TOGGLECONSOLE" to your config.cfg. If it still doesn't work, you didn't complete the 2nd sub-section on this page!

Anyhow, this is the console. Anything you put into a cfg file you can enter here, and visa-versa (note, only certain client variables and binds are saved, aliases are not save when you enter them into the console or your config.cfg). So go ahead and type the following into the console:

bind "k" "hello"
(note: if you have k bound to something important, change it to any key of your choice). Now, press K.

Hooray! Your first alias worked, you said Hello World!, killed yourself, and remarked Goodbye World! to your dead teammates.
Huzzah!

If your alias didn't work, start this subsection over. You probably messed up at the console, or with your autoexec.cfg

-rizzuh and NextWish