You are here

Part 6 - Setting Up The CS:S Game Server Files

* Server directories *

Recall from the server setup section that I place my game server files on their own partition:

S:\hlx\27015\ - HLstatsX
S:\httpd\ - Apache
S:\mysql\ - MySQL
S:\perl\ - Perl
S:\PHP\ - PHP

T:\srcds\27015\ - CS:S Game files

* Obtaining the HLDS Update Tool *

Before you get started with downloading the CS:S game server files, you'll need to download and install SteamCMD:

https://developer.valvesoftware.com/wiki/SteamCMD

Download the zip file and extract it to a directory. I have mine extracted to T:\srcds\CteamCMD. When complete you should have an application in the directory called SteamCMD.exe.

* Downloading the CS:S game server files *

I use a simple batch script to download/update the server files:

T:\srcds\SteamCMD\steamcmd.exe +login anonymous +force_install_dir T:\srcds\27015 +app_update 232330 +quit
pause

When I'm setting up a new server, I always run the script a couple of times to make sure every file is downloaded. Your game server files are complete when the Checking/Installing headers show no activity. You can also add validate to the end of the update command to force the update tool to check all files.

* Setting up the server configuration files *

In the simplest of server setups, you'll want to create a file called server.cfg. It resides in the cfg sub-directory (e.g. T:\srcds\27015\cstrike\cfg\). I host Surf and GunGame servers, and the following is an example server.cfg from a Surf Server:

hostname "A Sample Surf Server"
sv_downloadurl "http://your.fast.download.url/cstrike"
sv_password "testing"
fps_max 0
log on
logaddress_add 10.10.10.25:27500
decalfrequency 60
host_framerate 0
mp_allowspectators 1
mp_autokick 0
mp_autoteambalance 1
mp_buytime 120
mp_c4timer 45
mp_chattime 15
mp_fadetoblack 0
mp_falldamage 1
mp_flashlight 1
mp_footsteps 1
mp_forcecamera 0
mp_freezetime 1
mp_friendlyfire 0
mp_hostagepenalty 0
mp_limitteams 2
mp_maxrounds 0
mp_restartgame 0
mp_roundtime 3
mp_spawnprotectiontime 0
mp_startmoney 0
mp_timelimit 25
mp_tkpunish 0
mp_winlimit 0
net_maxfilesize 64
sv_accelerate 5
sv_airaccelerate 150
sv_allow_wait_command 0
sv_allowdownload 1
sv_allowupload 1
sv_alltalk 1
sv_bounce 0
sv_cheats 0
sv_client_cmdrate_difference 30
sv_client_min_interp_ratio 1
sv_client_max_interp_ratio 1
sv_client_predict 1
sv_enableoldqueries 1
sv_footsteps 1
sv_friction 4
sv_gravity 800
sv_lan 0
sv_logbans 1
sv_logfile 1
sv_maxrate 40000
sv_maxspeed 320
sv_maxcmdrate 100
sv_maxupdaterate 100
sv_mincmdrate 30
sv_minrate 10000
sv_minupdaterate 30
sv_pausable 0
sv_pure 0
sv_region 0
sv_rollangle 0
sv_rollspeed 200
sv_stepsize 18
sv_stopspeed 75
sv_timeout 40
sv_visiblemaxplayers 24
sv_voicecodec vaudio_speex
sv_voiceenable 1
sv_wateraccelerate 10
sv_waterfriction 1
exec banned_user.cfg
exec banned_ip.cfg
writeid
writeip

The other file you'll want to modify is motd.txt located in the cstrike folder. I modified mine to load an MOTD page from my web hosting:

http://cstrike.nyfiber.net/motd.txt (Right-click, Save File As)

* Basic server start-up *

To start the server, you'll want to create a shortcut to srcds.exe at the top-level of your CS:S game server files (i.e. T:\srcds\27015\orangebox\srcds.exe). Right-click the shortcut and choose Properties. You'll want to modify the Target: line to add some key options:

T:\srcds\27015\srcds.exe -console -game cstrike +map de_dust2 +maxplayers 24 +ip 10.10.10.25 -port 27015 -nocrashdialog +fps_max 0

This shortcut is very basic and will not restart the server in case it crashes (see the section on server start-up). Please note that maxplayers can only be modified here (and not after the server has started).

At this point your server should start up and be running a map. If you copy/pasted the configuration from above, you'll need to use the password testing to connect to your server.