Server Variables - Source Engine

From Nitradopedia EN
Jump to: navigation, search
Garrysmod wiki.jpg
Rent your own prepaid Nitrado Game Server today at nitrado.net


What are server variables?

With server variables (English CVAR or ConVar, ConsoleVariable) you can configure Source Engine Server. For example, server variables can be used to set the server name, the server password, the round times, and more. By default, there are hundreds of server variables in Source Engine servers. These are extensible with plugins and addons. The most important are summarized in this article.

About which games is this article?

This article was originally written for the following games:

  • Half-Life 2: Deathmatch
  • Counter-Strike: Source
  • Counter-Strike: Global Offensive
  • Day of Defeat: Source
  • Team Fortress 2
  • Left 4 Dead
  • Left 4 Dead 2
  • Garry's Mod

The things mentioned here could also work in other source engine games. You just have to try it out.

The variables and associated files

Generally one can say that all files on the server with the ending ".cfg" contain variables. The default folder for these files is the same for all source servers: (Examples created using a CS: GO server)

  • /Csgo/csgo/cfg

Mods such as e.g. Sourcemod partially create its own folder within this folder. Furthermore, Sourcemod still has a separate folder in which partly *.cfg files are included.

  • /Csgo/csgo/cfg/sourcemod
  • /Csgo/csgo/addons/sourcemod/configs

Generally, everything the server inherently brings to variables, belongs to the server.cfg. All variables represented by e.g. A plugin may be included in either the associated config file or in e.g. The sourcemod.cfg.

For many variables, it is not mandatory, but for some, it is crucial in which file the variable is located. The reason is that e.g. The server.cfg is loaded at server startup and every map change, while other config files are loaded later. (E.g., only when a player enters the server)

Where do I set server variables?

It is best to set the server variables by going into the web interface and then editing the server.cfg. To do this, call the Config Editor [extended] v2 " ', select the' Server.cfg 'of the desired game and click Edit An alternative option is to set the server variables via the so-called RCON protocol. This is only recommended if you just want to test something and do not want to go into the web interface. Because the decisive disadvantage is that the settings disappear after a server restart. The variables are also to be rewritten after a mapchange, if these are already present in a configuration file It may be that plugins, especially Sourcemod, have their own configuration files. However, this is then described in the respective article If a lot of configuration files are used, the corresponding file can also be downloaded and edited locally on the PC. For this purpose, a FTP connection with a tool such as FileZilla and a simple text editor. (Notepad/Editor of Windows or an extra program like Notepad ++)

How do I set a server variable?

There are three parts of the server variable in exactly the same order: Variables, spaces, and the value of the variable. Variables are separated by a line break.
Basically, one can say that variables do not expect the numbers to be quotes. If you have values ​​with letters, you should place them in quotation marks due to special / blanks. Two examples:  Hostname "Nitrado Gameserver"  mp_timelimit 30 The first variable sets the server name to the value "Nitrado Gameserver". Because the value is a space, the value must be enclosed in quotation marks. The second variable sets the maximum time played on a map to 30 minutes. Since this is a numeric value, the value does not have to be enclosed in quotation marks If you only need the current value of a variable, you can display it by querying the variable without value via the server console (for example, ViaIngame console or HLSW).

Frequently used server variables

Before I list each variable in a table I want to explain only briefly something. In the table, I will use these three labels at "possible value".

  • String (value with numbers/characters, for example "This is my great N! Tr4do server.", Always put in quotation marks ( ")!)
  • Boolean (value of 'only' can have two states, 0 or 1)
  • Integer (value of the 'only' can have a numeric value.) The limits are given in the respective line.)
Variable name Possible value Impact and notes Unsupported games
hostname String Changes the server name None
sv_password String Sets a server password that must be entered before entering. If the value is not set, no password is required. None
rcon_password String Set the RCON password to access the server console. Choose a secure password! None
sv_region Integer (0-255) In which continent will your server be displayed in the ingame server browser? 3 = Europe, 255 = The whole world. More info here. None
sv_contact String Here you can write an e-mail address, which allows users to contact you. (Publicly visible) None
sv_alltalk Boolean Can players communicate with each other through the Voicechat in hostile teams? 0 = no, 1 = yes. None