A nostalgic game for many gamers from the years past, Counter Strike 1.6 is alive and well. With the recent Covid-19 pandemic, I've found renewed interest among my friends to return to this classic game. I've found it helpful to set up a dedicated server with a few bells and whistles on a linux server I had that wasn't being used for much. I'll go over the process that caused my half my hair density considering only official documentation as much as possible.
The only requirement for this guide is a headless Linux server. I'm using Ubuntu 16.04 64bit (quite old at this point, but shouldn't make a difference).
Installing Counter Strike Dedicated Server
The first step is of course to install the game.
Install steamcmd
steamcmd
is a developer tool from Valve
which allows relatively painless installation of dedicated servers.
Instructions for downloading,
and running
steamcmd
are available from valve. I
recommend reading through the official page which has information for
Windows, Linux, and macOS installation. To recap:
# add-apt-repository multiverse
# dpkg --add-architecture i386
# apt update
# apt instal lib32gcc1 steamcmd
then run steamcmd
on the commandline,
login anonymously by executing login anonymous
, and install counter strike by
first indicating the location to install the app and then running app_update
:
> force_install_dir /some/path/
> app_update 90
> app_set_config 90 mod cstrike
> app_update 90 validate
I've set my path to /home/<user>/cs16
, but it could be any
path on your filesystem. Make sure to run the last command multiple
times to make sure it has worked as there's a bug where app id 90 (HLDS)
requires multiple installs to install all game files. This bug is
mentioned here.
90
refers to half life steam application
id ("app id") and can be found either by going to steam and searching
for the app, or if you're installing a dedicated server as is the case
here, search through the dedicated
server list, scrolling down to your platform, and you'll see the
column named ID
. SteamCMD
refers to whether it can be installed
through steamcmd
program.
What is not mentioned there is that to download counter strike
specific files, you need to set the mod to cstrikee
through app_set_config 90 mod cstrike
at the steamcmd
prompt (see above).
Once the game is installed, running a server is now possible by
running hlds
with appropriate options:
/some/path/hlds_run -game cstrike -pingboost 2 +map de_dust2 +maxplayers 32
See this
article for a list of all command line options. Most noteworthy is
pingboost
. Port 27015
is the default, try setting other ports if
you so desire, or leave it out to use 27015
as default as I have done here.
At this point, you may not be able to connect to your server if it's located outside your LAN.
Setting up port forwarding
If your server is outside your LAN, steam requires a few ports to be
open. Review all required
ports by steam here. In short, for our purposes you need to open
port 27015 both TCP and UDP. If you have altered the default port in the
previous step, you should open that port instead. Since I'm using
Ubuntu, I'll use iptables
to do this.
iptables -A INPUT -p tcp -m tcp --dport 27015 -j ACCEPT
iptables -A INPUT -p udp -m udp --dport 27015 -j ACCEPT
Now you should be able to join your server. If you don't require any other bells or whistles, this is as far as you need to read. Enjoy playing!
Additional Maps
Part of the nostalgia lies within the alternate maps I used to play
with friends at the local GameNet. I have found GameMaps.com relatively good for
finding maps, although I didn't search too hard and am not aware of any
other map repositories. My favorite maps include aim_map
and fy_iceworld2k
. Once you download the zip file,
you can extract all the files in /path/to/cs16_directory/cstrike/maps
. Now you
can issue changelevel <map name>
in
the console to change the map. All of this will be easier with mods.
Voting and Deathmatch: Metamod, AMX Mod X, and CSDM
Metamod and AMX Mod X are Mod managers with some facilities that make mod creation and management easier. CSDM is short for Counter Strike DeathMatch. Metamod is the initial mod manager, AMX Mod X is a plugin for Metamod, and CSDM is a plugin for AMX Mod X, hence why it's required to install these in order.
Metamod
The official
documentation is fantastic and easy to follow. Essentially, create
the directory cstrike/addons/metamod/dlls/
and extract the metamod linux binary
in there. The metamod download archive contains .so
or .dll
files
which should be put in the dlls
directory
you just created. Then edit liblist.gam
in
the game directory cstrike
and change the
lines
gamedll "dlls/mp.dll"
gamedll_linux "dlls/cs_i386"
to
gamedll "addons/metamod/dlls/metamod.dll"
gamedll_linux "addons/metamod/dlls/metamod_i386.so"
depending on which platform you use (gamedll
for windows, and gamedll_linux
for linux).
AMX Mod X
The documentation for AMX Mod X is a bit scattered. The installation documentation is fairly well laid out:
- download the base package along with a game addon from the download link on the official site. In our case,
AMX Mod X Base
andCounter-Strike Addon
. - extract those into
addons
directory. - let Metamod know to load AMX Mod X by adding
linux addons/amxmodx/dlls/amxmodx_mm_i386.so
to the filecstrike/addons/metamod/plugins.ini
. - Configure AMX Mod X
I have found the default plugin set to be adequate, short of the deathmatch plugin which is not included by default.
Configuring AMX Mod X
A fantastic explanation of configuration is available at the old AMX mod site which applies fairly well as far as configuration is concerned. What I have done is to go through every file, read the comments, and modify to my liking. The only big issue I had was to set an admin user.
Go through the old AMX mod site's plugin
file overview which has an overview of every file in configs/
and set every option you like.
Set Admin user
I decided to set the admin user by steam id. To find your steam id,
join any game or server, start game console, and type status
. It should give you your steam id which
looks like STEAM_0:X:NUM
where X and NUM
are numbers. Then copy that into users.ini
under addons/amxmodx/configs/
like so:
"STEAM_0:X:NUM" "" "abcdefghijklmnopqrstu" "ce"`
To find out what those 3rd and 4th column flags mean, read the the
rest of the users.ini
file or refer to this
overview.
You should now be able to go through AMX Mod X commands and try them out.
Counter Strike Deathmatch (CSDM)
CSDM is a plugin for AMX Mod X. The original
CSDM plugin version 2.1 seems to be outdated and not working. The
KWo version 2.1.3d is the most recent one that I've found worked very
well as of today. Follow the
KWo CSDM thread where new versions are released. To install,
download the zip file provided there and extract into addons/amxmodx
directory as mentioned in the official
installation documentation which applies to the KWo version just as
well. I had to add csdm_amxx
to addons/amxmodx/configs/modules.ini
to get it
working.
To configure CSDM, read through the comments in config files in addons/amxmodx/configs/csdm_*
and look at the configuration and
commands documentation and set the options to your liking.
Putting it all together
I wanted to have a way for my friends to be able to enable or disable
FFA mode and CSDM and to be able to vote for maps. So I added the
following to addons/amxmodx/configs/cmds.ini
:
"Restart Round" "sv_restartround 1" "a" "u"
"Vote For Map" "amx_votemapmenu" "b" "j"
"Cancel Vote" "amx_cancelvote" "b" "j"
"Toggle Deathmatch" "csdm_ctrl" "a" "u"
"Toggle Free For All" "csdm_ffa_ctrl" "a" "u"
q#+end_src
I have also had to relax access control to allow people to change deathmatch and ffa status. So I've modified the default access for users so they have access to menus and voting in =amxx.cfg=:
#+begin_src conf
amx_default_access "ju"
and modified cmdaccess.cfg
to allow
toggling csdm and ffa be runnable by persons who have ju
permission. I'm not sure whether this step is
necessary.
"csdm_ffa_enable" "u" ; csdm_ffa.amxx
"csdm_ffa_disable" "u" ; csdm_ffa.amxx
"csdm_ffa_ctrl" "f" ; csdm_ffa.amxx
"csdm_enable" "u" ; csdm_main.amxx
"csdm_disable" "u" ; csdm_main.amxx
"csdm_ctrl" "f" ; csdm_main.amxx
And I've told everyone to run amx_cmdmenu
in console and look at the menu to
toggle options!
Happy fragging!