Setup a Linux Counter Strike: Source Gun Game Server

UPDATE

Steam has updated to SteamCMD. More details here. May update this post eventually: https://developer.valvesoftware.com/wiki/SteamCMD

About a month ago I dug out an older server and wanted to do something with it. Using WINE I made a few game servers with the HLDS tool. Here I will give a quick guide to setup a CSS Gun Game 5.1 from a blank system with the Linux binaries.

1) Installing an operating system
You can use pretty much any Linux distribution for this but for the point of keeping it simple and setup fast we will use Ubuntu Desktop Edition so that we have a window manager for the server. (I suggest using something like Debian if you have a bit of time and want to learn Linux)

2) Get yourself on the Internet
Make sure that you have got the Internet setup on your server. This is simple enough with an Ethernet connection as the operating system pretty much does its own. However, in the case of it not working or using wireless (Not recommended for a server) there are many guides on the Internet.

Here are a few links just in case:
Networking with Ubuntu Guide:  http://www.debianadmin.com/ubuntu-networking-for-basic-and-advanced-users.html
Wireless Trouble Shooting:  https://help.ubuntu.com/community/WifiDocs/WirelessTroubleShootingGuide
Installing a Windows wireless driver:  https://help.ubuntu.com/8.04/internet/C/ndiswrapper.html

3) Get the HLDS tool
Open a terminal window: Applications > Accessories > Terminal
First we will make a server folder to put our server in.
Type the following into the terminal, one line at a time ignoring everything in brackets.
mkdir server (Makes a folder called server)
cd server (Changed the directory to the one we just made)
wget http://www.cstrike-planet.com/dls/hldsupdatetool.bin (Downloads the tool into the server folder)
chmod +x hldsupdatetool.bin  (Give the file permission to execute)
./hldsupdatetool.bin (Start the install)

After executing all of these commands the install wil start and we just follow the on screen instructions. We will be left with a steam file in the directory. If everything went well then you should be ready to get the server files.

4) Download the Dedicated server files
Run the following commands in the terminal ignoring what is in the brackets.
chmod +x steam (make steam executable)
./steam -command update -game “Counter-Strike Source” -dir . (runs the update command for counterstike source in the current directory)

This can take a long time so … you can go make a coffee or something.
If this didn’t work make sure you didn’t forget the full stop at the end of the ./steam line, its kind of important.

5) Install event scripts
For Gun Game to work event scripts have to installed. The installation information and the installation files are here: http://forums.eventscripts.com/viewtopic.php?f=90&t=17891
The installation is simple copying into the addons folder really. The addons folder is in the folder server > cstrike > addons
Make sure that the date at the top of the file: server/cstrike/addons/eventscripts/_libs/python/playerlib
The date is: “# Date of release 05/12/2008” or later, if it is not then the file will have be replaced with this file: http://gungame5.com/playerlib.py

6) Install the Gun Game content
Download the Gun Game 5.1 files from here: http://forums.gungame5.com/download.php
Unzip the files by right clicking the file downloaded and select extract. To install the files all we have to do is simple copy and paste. Open the cstike folder and paste the files in here. It may ask you what you want to do about the folders that already exist. For this you should select merge and the files will be added into the existing folders.

7) Add an Addon
One of the addons that I quite like is the winner display, and as a bonus you can make your own custom page if you know html and a bit of php which is simple enough.
First download the addon from here: http://forums.gungame5.com/viewtopic.php?f=74&t=1122
Extract the files.
To install to the server copy the addons folder from the download and paste it in the server folder, click the merge option if prompted.

8 ) Automatically start the Gun Game addon when the server is started
Open the following file, if it does not exist then make it:  server>cstrike>cfg>server.cfg
Add the following lines to it and then save:
hostname “Your Hostname Here”
es_load gungame51

You can add alot more to this file, it is executed when the server starts each time and can be used to automatically add bots etc.

9) Run your server
In the Terminal in the server directory type the following to start the server:
./srcds_run -game cstrike +maxplayers 20 +map cs_office (This will start the server)

10) Connect to it
To connect to it from another computer on the network we need to find the local IP address.
On the server machine in the Terminal type in ifconfig, this will give you a list of your connections and the connected ones will have an IP address. Generally it will be something like 192.168.xxx.xxx on a home network. Open up Counter Strike and connect to your server through the console, you can enable this in your keyboard settings.
In the console type “connect 192.168.xxx.xxx”. Replacing xxx with the numbers you got from the ifconfig.

You should be connected to your server. Congratulations!

However if you didn’t there is a fair chance you need to setup port forwarding on your router. To do this you should look up your router as every router is different.The ports that needs to be forwarded are 27000-27015 however I managed to get away with just 2015 forwarded. Here can help http://portforward.com/

Extras!

Lets face it … A Gun Game can be … slow and the default maps are not the best for Gun Games. All of the settings can be found in the Gun Game cfg file: server > cstrike > gungame51 > included_addon_configs

To get a nice little fast paced deathmatch server going you should edit the following files and change these values, a description about what each file does can be found in that file( – means file and * means value in the file to be changed. Ignore the * when editing it ) :

-gg_deathmatch
*gg_deathmatch 1
*gg_dm_respawn_delay 1

-gg_dissolver
*gg_dissolver 6

-gg_earn_nade
*gg_earn_nade 1

-gg_knife_pro
*gg_knife_pro 1

-gg_noblock
*gg_noblock 1

-gg_knife_pro
*gg_knife_pro 1

-gg_spawn_protect
*gg_spawn_protect 3

-gg_turbo
*gg_turbo 1

Maps:
Some of the maps for the Gun Game you might like are:
– gg_lego_arena
– gg_mario
– gg_mario_bloodarena
– gg_gardenworld
– gg_aim_shotty

Maps can be found on Google simply enough by searching but here are a few websites anyway:
http://www.fpsbanana.com/maps/games/490
http://www.dgames.tkdami.net/download/css/maps/

The vote list is the list of maps the players can vote for at the end of the round. The maps that you want to play just put in the maps folder and it will automatically use them.

To enable map voting:
-gg_map_vote
*gg_map_vote_time 30
*gg_map_vote_list_file 4

Thats just about it generally, the rest is up to you to explore and mess around with … Enjoy!

This entry was posted in Tutorial and tagged , , , , , , . Bookmark the permalink.

One Response to Setup a Linux Counter Strike: Source Gun Game Server

Leave a Reply

Your email address will not be published.