Last server records
Pro Nub

Console commands and variables. What are cvar and bind?

Posted by Kpoluk 28 Jun 2018 in 18:25
Table of contents:

Standard console commands
Standard console variables
CS 1.6 Options
CS 1.6 config
Additional commands and variables of AXM Mod X


Standard console commands


Let's start from console commands. When you press, for example, D button, you send command "move forward" to the game. In its language this command looks like +moveright. When you releaes D, you send command "stop moving forward", i.e. -moveright. Same commands could be sended in console (console is opened by ` button), you just need to write them in a field below and press Enter:


Besides these two commands CS 1.6 knows many others. But what if we want to attach some other command to D button? There is a command for this too, it's just a bit more complicated since it has two arguments:


Here we used bind command with arguments D and +duck. The first argument is a button, the second is an action (we quote arguments, but since they don't have spaces, quoting is not necessary in that case). Thus we binded command "sit down" to the D button. At that CS 1.6 understands that when we release D, -duck (i.e. "stand up") command should be called.

To detach command from the button, type in unbind "D". As you can see, unbind command has only one argument - button's name.

To restore D button's old action, write bind "D" "+moveright". Quite simple, right? :)


Standard console variables


Console variable (or cvar) could be also written in console to send instructions to the game. But destination of cvars is a bit different. It has usually one argument and used for setting up the game in a certain way. For example, if you write in console sv_gravity 400, gravity will become twice less (by default gravity value is 800).

Note: if you use our LAN server (which can be downloaded here), than variables like gravity are forced to their legal values at server launch. If you change these variables during demo recording, you will see a warning after map passsing.

There are client and server cvars. sv_gravity is an example of server cvar, and that's why it's available through server console. While playing on your LAN server you are both client and server, so you are able to use both type of cvars.


CS 1.6 Options


When we launch some map through New Game, we can click Game tab next to Server and set up a bunch of server parameters. Now you understand that this tab actually allows us to change some server cvars.

Options Menu of CS 1.6 is in fact just a handy interface for changing the most usable client cvars. A few examples are signed on screenshots below:



Now let's examine Keyboard tab. Here we can attach actions to one or two buttons. "This is what bind command does!", - you would say, and this is absolutely correct. Suppose you've just installed CS 1.6 and want to set jump on scrolling up. You can write bind "MWHEELUP" "+jump" and also there is anonther way: open Keyboard tab, click on Jump line (by default there is only Space as a primary button), choose Edit key (or just press Enter) and scroll up. You will see that Mouse Wheel Up became your primary key and Space is now alternate key:


Don't forget to press Apply to save changes (while OK will save changes and close Options dialog). Now you are able to jump using both scroll and space (and both of them will turn to be useful in kreedz).


CS 1.6 config


Now open file config.cfg located in cstrike folder:


As you can see, there is nothing more than a bunch of console commands and cvars. The very first is unbindall command which performs unbind for all button. Then a list of binds attaches actions to the buttons. And below there are a few dozen of client cvars and commands. This config runs at every game start. That's all, this is a point of player's config :)

Case 1. If you accidently wrote unbindall in console, do not worry. If you are on the server, disconnect (don't quit the game) and write exec config.cfg. Don't try to write it while being on server since its anticheat could ban you (doesn't apply to our servers).


Additional commands and variables of AXM Mod X


And now goes the most interesting part. Such thing as AMX Mod X allows us to add ingame plugins that give various handy functions, new console commands and cvars. For instance, when admin uses amx_ban command, he should be grateful to plugin amdincmd.amxx for this capability.

KZ-Rush LAN server contains standard AMX Mod X plugins plus plugins written specially for kreedz. To obtain a list of all accessible commands provided by AMX Mod X, write amxx cmds in console. Similarly to obtain a list of all cvars and their values, use amxx cvars.