Skip to content

Latest commit

 

History

History
707 lines (449 loc) · 124 KB

README.md

File metadata and controls

707 lines (449 loc) · 124 KB

Counter-Strike 2 (CS2) Modded Dedicated Server

About

A single modded Counter-Strike 2 (CS2) Modded Dedicated Server that you can change the active mod on the server from chat or server console. Maps are preconfigured per game mode and change when the game mode changes.

Each game mode has a hand full of maps preset so you are ready to go and it's easy to add more.

Every time you want to boot the server, you should run gcp.sh (if on Google Cloud) or install.sh (on Linux) and it will ensure your OS is up to date, CS2 is up to date, and pull down the latest patches from this mod (any updates that I push up).

Obviously, any changes you have made to the files in this mod will be overwritten so I have created a "custom files" folder where you mirror the contents of the game/csgo/ folder, and any files you want to tweak, you put in there in the same spot and they will always overwrite the mods default files. Read more about it here.

The simple quick setup:

  1. Create your firewall rules
  2. Provision your server on Google Cloud
  3. SSH into server
  4. Install mod
  5. Create your custom files for hostname, admins etc
  6. Ensure you have followed the steps for creating an online server or LAN server
  7. Kill server if running ./stop.sh and start again gcp.sh (if on Google Cloud) or install.sh (on Linux)

Your server should be up and running!

To check everything is working correctly run the following commands in the server console:

  • meta list and you should see CounterStrikeSharp in the output
  • css_plugins list and you should see a few plugins in the output

If you see content in both; everything is working.

Important

Using RCON whilst connected to the server does not work. See discussion here. The current work arounds are:

  • I have included CS2Rcon which allows admins to use !rcon in chat.
  • You can disconnect from the server and use rcon_address IP:PORT in console and you can use rcon commands.
  • Use an external RCON program which has implemented the RCON protocol such as this.

Useful things to know:

Getting up and running:

Mods installed

Mod Version Developer Why
Metamod:Source 2.0.0-1293 Community-Project Sits between the Game and the Engine, and allows plugins to intercept calls that flow between
CounterStrikeSharp 247 roflmuffin Attempts to implement a .NET Core scripting layer on top of a Metamod Source Plugin, allowing developers to create plugins that interact with the game server in a modern language (C#)
CleanerCS2 v1.0.3 Poggicek Allows you to filter out console prints with regular expressions
ServerListPlayersFix 1.0.1 SDK Rebuild 28/6/2024 Poggicek Fixes players not showing up in the server browser
CSSharp-Fixes 1.0.1 CharlesBarone This plugin is intended to replace CS2Fixes for servers that run CS# since CS2Fixes often conflicts with CS# plugins.
CS2VoiceFix 1.0.0 Poggicek Experimental plugin that attempts to fix voice chat breaking after addon unloads. (Disabled by Default - see here activation steps.)
AnnouncementBroadcaster 0.3.1 Lengrann Conditional messages, OnCommand, OnPlayerConnect, OnRoundStart, and TimerMsgs.
AntiRush 1.0.1 oscar-wos Customize your own boundaries on maps to teleport, warn, hurt, and kill players/bots trying to cross contraint areas.
CS2Rcon 1.2.0 LordFetznschaedl This is a rudimentary implementation of a RCON plugin using CounterStrikeSharp as RCON does not work whilst connected to the server
CSTV-Discord 1.2.7 K4ryuu Discord Webhook message broadcasts with full-match or single round demo uploads to Mega Upload or direct to Discord.
CustomRounds 0.0.9 schwarper Custom rounds for weapon practice on aim/awp/etc maps when default weapons don't cut it
Deathmatch 1.1.6 NockyCZ Custom Deathmatch plugin (Includes custom spawnpoints, multicfg, gun selection, spawn protection, etc)
Deathrun Manager 0.0.8 leoskiline Improves Deathrun gameflow.
Discord Utilities 2.0.5 NockyCZ (Enabled by default.) 2-Way chat relay, discord role/game-server perm mgmt, event monitoring, and player reporting. How?
Executes 1.0.5 zwolof & B3none Implementation of executes. Based on the version for CS:GO by Splewis.
ExecAfter 1.0.0 Kus Executes a command after server event (i.e. OnMapStart) or a delay.
FunMatchPlugin 1.1.0 TitaniumLithium Executes a command after server event (i.e. OnMapStart) or a delay.
GameModeManager 1.0.43 nickj609 Simplified administration and voting management for custom modes and map switching/extending.
GunGame 1.1.1 ssypchenko GunGame mode
K4-Arenas 1.4.4 K4ryuuu A plugin that allows players to fight 1v1 in ranked arenas.
Map Configs 1.0.6 oqyh Allows you to quick and easily create unique configuration files for each map on your server.
MatchZy 0.7.13 shobhit-pathak MatchZy is a plugin for running and managing practice/pugs/scrims/matches with easy configuration!
MultiModGameStateMgr 0.0.1 audiomaster99 Assisting with game states when the server is empty, and gains a player. Be sure to unload with conflicting plugins (ex. Retakes), and reload plugin switching away from conflicting plugins.
OpenPrefirePrac 0.1.39 Lengran Similar to Yprac and Refrag prefire modes.
Remove Map Weapons 1.0.1 Kus Remove weapons from the map as mp_weapons_allow_map_placed 0 does not work.
Retakes 2.0.7 B3none Implementation of retakes. Based on the version for CS:GO by Splewis.
Retakes Allocator 2.3.10 yonilerner Advanced weapon allocation for retakes
BombAnnouncer 0.0.6 audiomaster99 Graphical Bombsite Announcer using Center HUD image capability.
Instadefuse 1.4.3 B3none Allows a CT to instantly defuse the bomb when nothing can prevent defusal.
Retakes-Zones 1.0.2 oscar-wos Invisible walls that bounce players back into the right direction of the Retake objectives.
RockTheVote 1.8.5-custombuild abnerfs General purpose CS2 map voting plugin.
SimpleAdmin v0.1.2 connercsbn Adds basic administrator functions
SharpTimer 0.2.6 DEAFPS All-in-One BHop/KZ/Surf/etc timer, movement-unlocker, ranking, and stats plugin
Tags Build 36 daffyyyy Adds Tags to a select group of clients' aliases on the server
Whitelist 1.0.0 PhantomYopta Restricts access to the server for SteamID members/employees listed in the whitelist. How?

Custom files

Note

Any reference to a path is always the root of the installation. Which on Linux will typically be /home/steam/cs2/ and on Windows where ever you extracted the zip.

For example on Linux: /custom_files/addons/counterstrikesharp/configs/admins.json full path is /home/steam/cs2/custom_files/addons/counterstrikesharp/configs/admins.json /game/csgo/addons/counterstrikesharp/configs/admins.json full path is /home/steam/cs2/game/csgo/addons/counterstrikesharp/configs/admins.json

Any changes you have made to the files in this mod will be overwritten when the update scripts are ran. I have created a folder /custom_files/ in the root of the project, where you mirror the contents of the csgo/ folder, and any files you want to tweak, you put in there in the same spot and they will always overwrite the mods default files.

So this can be used to set the server hostname to something you want, set the RCON or serverpassword or set the admins of the server.

You can see an example of what I use on my server in the /custom_files_example/ directory, which sets the hostname, server image and admins.

For example; if you want to add yourself as an admin, that file is located /game/csgo/addons/counterstrikesharp/configs/admins.json. So to make your tweak to it, you would copy that file to /custom_files/addons/counterstrikesharp/configs/admins.json and add yourself as an admin at the bottom. Then when the update scripts run, it will copy your custom file at /custom_files/addons/counterstrikesharp/configs/admins.json and overwrite the default mod file at /game/csgo/addons/counterstrikesharp/configs/admins.json.

If you want to change the server name, or make any changes to any mod settings use the /cfg/custom_MOD.cfg as it executes at the end and can overwrite any setting. So if you wanted to change the server name for GunGame, you would copy /game/csgo/cfg/custom_dm.cfg to /custom_files/cfg/custom_dm.cfg and and write hostname "shipREKT GunGame +Deathmatch +Turbo" and any other settings you want and this file will overwrite /game/csgo/cfg/custom_dm.cfg each time the gcp.sh/install.sh/win.bat script is ran, and these settings will run at the end when you load the GunGame mod.

Dynamically creates config files in plugin folder

If a plugin creates a config file in the plugins folder where the dll is (i.e.: /game/csgo/addons/counterstrikesharp/plugins/CS2AnnouncementBroadcaster/cfg/messages.json) it will be deleted when the server starts as the addons folder is deleted to make sure old plugins are removed if I removed them. You need to copy this file and your changes to your /custom_files/ folder so it merges it back in. You would put the example file in /custom_files/addons/counterstrikesharp/plugins/CS2AnnouncementBroadcaster/cfg/messages.json and every time the server starts it will merge it back in and you will have your changes.

To generate this directory, you can run the gcp.sh script (if on Google Cloud), install.sh script on Linux once or on win.bat script on Windows where you extracted the mod zip and this is where you would put your custom modifications.

Creating an online server

If you are hosting an online server, you need to create a Steam Game Login Token, your server will not run online without this. Put this value in the STEAM_ACCOUNT environment variable.

You also need to create an authorization key which will allow your server to download maps from the workshop. Put this value in the API_KEY environment variable.

See all available environment variables.

You must connect to the server from the public IP, not the LAN IP even if you are on the same network. The script logs the public IP Starting server on XXX.XXX.XXX.XXX:27015

Creating a LAN server

Set the environment variable LAN to 1.

You also need to create an authorization key which will allow your server to download maps from the workshop. Put this value in the API_KEY environment variable.

See all available environment variables.

Environment variables

Available via environment variable only

On Windows set these in win.ini.

Key Default value What is it
API_KEY changeme To download maps from the workshop, your server needs access to the steam web api. To allow this you'll need an authorization key which you can generate here
IP `` Not required. Allows the server IP to be set. Useful if a CS2 server needs to be bound to a specific IP address.
PORT 27015 Server port
MAXPLAYERS 32 Max player limit
CUSTOM_FOLDER custom_files Folder of your own modifications to the mod that mirror the csgo/ structure and overwrite the mode files. More on that here
RCON_PASSWORD changeme RCON password to control server from console also remotely configure
STEAM_ACCOUNT `` To host a server online, you need to create a Steam Game Login Token. Your server will not run online without this
SERVER_PASSWORD `` If you want a password protected server
LAN 0 If the server is a LAN only server
EXEC on_boot.cfg Config file to run when server boots. If switching gamemode, it's recommended to do a delay see the example on_boot.cfg file
DUCK_DOMAIN `` (Linux only) Duck DNS domain if you want to utalise the free service to get a domain for your server instead of IP
DUCK_TOKEN `` (Linux only) Duck DNS access token to update domain when server boots

Playing workshop maps/collections

To download maps from the workshop, your server needs access to the steam web api. To allow this you'll need an authorization key which you can generate here and set API_KEY to the key.

The console command for hosting a workshop map is host_workshop_map fileid where fileid is the number that comes after ?id= in the workshop URL for example: https://steamcommunity.com/sharedfiles/filedetails/?id=2433686680

The console command for hosting a workshop collection is host_workshop_collection collectionid where collectionid is the number that comes after ?id= in the workshop URL for example: https://steamcommunity.com/sharedfiles/filedetails/?id=1092904694. This command will then download all maps in the collection and create a mapgroup out of them, then host it.

Setting maps for different game modes

Copy the file /game/csgo/gamemodes_server.txt following the custom files steps (/custom_files/gamemodes_server.txt) and add the maps you want per gamemode. Most gamemodes fall under casual, but I have created unique groups for each mode so adding your own maps is easy by updating this one file.

It isn't required, but you should add the fileid into /game/csgo/subscribed_file_ids.txt following the custom files steps (/custom_files/subscribed_file_ids.txt) so the server keeps it up to date.

Running on Google Cloud

Create firewall rule

gcloud compute firewall-rules create source \
--allow tcp:27015-27020,tcp:80,udp:27015-27020

Create instance

Ensure you have all the settings for your environment variables.

If you have issues with the server not handling load, you may want to consider compute-optimized machine c2-standard-4.

gcloud beta compute instances create <instance-name> \
--maintenance-policy=TERMINATE \
--project=<project> \
--zone=australia-southeast1-c \
--machine-type=n2-standard-2 \
--network-tier=PREMIUM \
--metadata=RCON_PASSWORD=changeme,STEAM_ACCOUNT=changeme,API_KEY=changeme,DUCK_DOMAIN=changeme,DUCK_TOKEN=changeme,startup-script="echo \"Delaying for 30 seconds...\" && sleep 30 && cd / && /gcp.sh" \
--no-restart-on-failure \
--scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/compute.readonly,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/trace.append \
--tags=source \
--image-family=ubuntu-2204-lts \
--image-project=ubuntu-os-cloud \
--boot-disk-size=60GB \
--boot-disk-type=pd-standard \
--boot-disk-device-name=<instance-name>

SSH to server

gcloud compute ssh <instance-name> \
--zone=australia-southeast1-c

Install mod

sudo su
cd / && curl --silent --output "gcp.sh" "https://raw.githubusercontent.com/mavproductions/cs2-modded-server/master/gcp.sh" && chmod +x gcp.sh && bash gcp.sh

If the installation has paused for a long time, restart the server and do it again.

Stop server

gcloud compute instances stop <instance-name> \
--zone australia-southeast1-c

Start server

gcloud compute instances start <instance-name> \
--zone australia-southeast1-c

Delete server

gcloud compute instances delete <instance-name> \
--zone australia-southeast1-c

Push file to server from local machine

For example a map:

On local:
gcloud config set project <project>
cd /path/to/folder
gcloud compute scp de_kus.vpk root@<instance-name>:/home/steam/cs2/game/csgo/maps --zone australia-southeast1-c

On server SSH:
cd /home/steam/cs2/game/csgo/maps
chown steam:steam de_kus.vpk
chmod 644 de_kus.vpk

Download from server

gcloud compute scp root@<instance-name>:/home/steam/cs2/gamecsgo/cfg/comp.cfg ~/Desktop/

Turn VM off at 3:30AM every day

SSH into the VM

Switch to root sudo su

Check the timezone your server is running in sudo hwclock --show

Open crontab file nano /etc/crontab

Append to the end of the crontab file 30 3 * * * root shutdown -h now

Save CTRL + X

Running on Linux

Make sure you have 60GB free space.

Ensure you have all the settings for your environment variables.

  • If setting up internet server:

    Set environment variable STEAM_ACCOUNT to your Game Server Login Token

    Make sure you port forward on your router TCP: 27015 and UDP: 27015 & 27020 so players can connect from the internet.

    You must connect to the server from the public IP, not the LAN IP even if you are on the same network. The script logs the public IP Starting server on XXX.XXX.XXX.XXX:27015

  • If setting up LAN server:

    Set environment variable LAN to 1

sudo su
export RCON_PASSWORD="changeme"
export API_KEY="changeme"
export STEAM_ACCOUNT=""
export SERVER_PASSWORD=""
export PORT="27015"
export MAXPLAYERS="32"
cd / && curl --silent --output "install.sh" "https://raw.githubusercontent.com/mavproductions/cs2-modded-server/master/install.sh" && chmod +x install.sh && bash install.sh
  • If running for the first time

To check everything is working correctly run the following commands in the server console:

  • meta list and you should see CounterStrikeSharp in the output
  • css_plugins list and you should see a few plugins in the output

If you see content in both; everything is working.

When you join the server you can change game modes.

Running in Docker

Only tested on Windows 11 with WSL2 integration as backend

Make sure Docker is installed and about 40 GB disk space is free.

You can either Download this repo and extract it to where you want your server (i.e. C:\Server\cs2-modded-server) or use git and clone the repo git clone https://github.com/mavproductions/cs2-modded-server.git and run your server from inside of it. This way you can simply git pull updates.

  • If setting up for internet server:

    Set STEAM_ACCOUNT variable in .env-file in the root if the repository. For workshop maps set API_KEY in .env-file.

  • Build docker image:

docker build -t cs2-modded-server .

  • Run the server

docker compose up

Running on Windows

Make sure you have 60GB free space.

You can either Download this repo and extract it to where you want your server (i.e. C:\Server\cs2-modded-server) or use git and clone the repo git clone https://github.com/mavproductions/cs2-modded-server.git and run your server from inside of it. This way you can simply git pull updates.

All the following instructions will use the repo folder location as the root.

Create a folder steamcmd and download SteamCMD and extract it inside steamcmd so you should have \steamcmd\steamcmd.exe.

To download maps from the workshop, your server needs access to the Steam Web API. To allow this, open \win.ini and set cs_api_key to your Steam Web API Key.

  • If setting up internet server:

    Open \win.ini

    Set IP to your public ip

    Set STEAM_ACCOUNT to your Game Server Login Token

    Set API_KEY to your Steam Web API key (required to play workshop maps)

    Make sure you port forward on your router TCP: 27015 and UDP: 27015 & 27020 so players can connect from the internet.

    You must connect to the server from the public IP, not the LAN IP even if you are on the same network.

  • If setting up LAN server:

    Open \win.ini

    Set LAN to 1

    Set API_KEY to your Steam Web API key (required to play workshop maps)

Accept both Private and Public connections on Windows Firewall.

  • If running for the first time

To check everything is working correctly run the following commands in the server console:

  • meta list and you should see CounterStrikeSharp in the output
  • css_plugins list and you should see a few plugins in the output

If you see content in both; everything is working.

When you join the server you can change game modes.

FAQ

Player commands

!rtv

Players can start a vote to change the map in the current mod by typing !rtv in chat.

Vote to change map

!gamemode

Players can start a vote to change the game mode by typing !gamemode in chat.

Vote to change game mode

You can also start a specific game mode vote by typing !comp, !wingman, 1.6, !dm, !gg, !1v1, !awp, !aim, !prefire, !executes, !retake, !prac, !bhop, !kz, !surf, !minigames, !deathrun, !course, !scoutzknivez, !hns, !soccer.

What maps are preconfigured with each mode?

mg_10mans

de_ancient
changelevel de_ancient
de_anubis
changelevel de_anubis
de_dust2
changelevel de_dust2
de_inferno
changelevel de_inferno
de_mirage
changelevel de_mirage
de_nuke
changelevel de_nuke
de_overpass
changelevel de_overpass
de_thera
changelevel de_thera
de_vertigo
changelevel de_vertigo
de_cbble
host_workshop_map 3070212801
de_cache
host_workshop_map 3070244931
de_season
host_workshop_map 3073892687

mg_active

de_ancient
changelevel de_ancient
de_anubis
changelevel de_anubis
de_dust2
changelevel de_dust2
de_inferno
changelevel de_inferno
de_mirage
changelevel de_mirage
de_nuke
changelevel de_nuke
de_vertigo
changelevel de_vertigo

mg_aimmap

1v1_hospital
host_workshop_map 3140763900
aim_map_classic
host_workshop_map 3222291463
aim_map_s2r
host_workshop_map 3070260370
freebet_aim_map
host_workshop_map 3146122036
aim_inspire
host_workshop_map 3171874934
fy_pool_day
host_workshop_map 3070923343
aim_multigame
host_workshop_map 3245740485
aim_valerastan
host_workshop_map 3157627939
aim_anubis
host_workshop_map 3177201515
aim_deaglepark
host_workshop_map 3165438553
aim_ancient
host_workshop_map 3090340064
aim_refrag
host_workshop_map 3163827658

mg_awp

awp_bhop_rocket
host_workshop_map 3142070597
awp_minecraft
host_workshop_map 3109027085
awp_lego_2_winter
host_workshop_map 3088944650
awp_creek
host_workshop_map 3081154235
awp_japan_neon_cs
host_workshop_map 3166593524

mg_bhop

bhop_at_night
host_workshop_map 3077211069
bhop_dunedash
host_workshop_map 3118806244
bhop_internetclub
host_workshop_map 3103286752
bhop_ragnarok
host_workshop_map 3077153735
bhop_zunron
host_workshop_map 3077475505
bhop_1derland
host_workshop_map 3077596014
bhop_whiteshit
host_workshop_map 3078523849
bhop_cherryblossom
host_workshop_map 3082038560
bhop_arcturus
host_workshop_map 3088973190
bhop_kiwi_cwfx
host_workshop_map 3095219437
bhop_omnitopia
host_workshop_map 3079959870
bhop_vaporwave
host_workshop_map 3247326328

mg_casual

cs_italy
changelevel cs_italy
cs_office
changelevel cs_office
de_assembly
host_workshop_map 3071005299
de_aztec
host_workshop_map 3070960099
de_cbble
host_workshop_map 3070212801
de_pipeline
host_workshop_map 3079872050
de_biome
host_workshop_map 3075706807
guardian
host_workshop_map 3255907412
mp_raid
host_workshop_map 3070346180
de_mutiny
host_workshop_map 3070766070
cs_assault
host_workshop_map 3070594412
cs_militia
host_workshop_map 3089953774
minecraft
host_workshop_map 3186779271
de_akiba
host_workshop_map 3108513658
de_rats_1337_v2
host_workshop_map 3161693626
de_rats_kitchoon
host_workshop_map 3071818846
de_survivor
host_workshop_map 3077457651
fy_snow_y0
host_workshop_map 3084930277
de_ruins_d_prefab
host_workshop_map 3072352643

mg_Casual-1.6

aim_map_classic
host_workshop_map 3222291463
as_oilrig
host_workshop_map 3104677430
cs_assault_classic
host_workshop_map 3215705579
de_aztec_classic
host_workshop_map 3213800338
de_dust_classic
host_workshop_map 3078095785
de_dust2_classic
host_workshop_map 3070363499
de_inferno_classic
host_workshop_map 3172269001
cs_italy_classic
host_workshop_map 3212419403
cs_militia_classic
host_workshop_map 3144773563
de_nuke_classic
host_workshop_map 3205793205
cs_office_classic
host_workshop_map 3216844784
de_survivor_classic
host_workshop_map 3217247541

mg_course

cr_devisland_p1_v1
host_workshop_map 3076483842
mg_switch_course_v2
host_workshop_map 3070439729
cr_minecraft_jb_v2
host_workshop_map 3070896876
mg_metro_course_v1
host_workshop_map 3070463151
mg_alley_course_v2
host_workshop_map 3070455802
mg_glave_course_v2
host_workshop_map 3070445185
mg_office_course_v3
host_workshop_map 3070459211
mg_metal_course_v2
host_workshop_map 3070464208
mg_acrophobia_run_v2
host_workshop_map 3070463620
mg_metro_course_s2
host_workshop_map 3071040020
mg_circle_course_v3
host_workshop_map 3070434475
mg_simpsons_course_v2
host_workshop_map 3070447697
mg_sonic_course_v2
host_workshop_map 3070452642
mg_sky_realm_v3
host_workshop_map 3070451616

mg_deathrun

deathrun_playground
host_workshop_map 3164611860
deathrun_civilization
host_workshop_map 3188021118
deathrun_iceworld_cs2
host_workshop_map 3083325292

mg_dm-multicfg

de_mirage
changelevel de_mirage
de_inferno
changelevel de_inferno
de_vertigo
changelevel de_vertigo
de_dust2
changelevel de_dust2

mg_dm-valve

cs_italy
changelevel cs_italy
cs_office
changelevel cs_office
de_vertigo
changelevel de_vertigo
de_ancient
changelevel de_ancient
de_anubis
changelevel de_anubis
de_dust2
changelevel de_dust2
de_inferno
changelevel de_inferno
de_mirage
changelevel de_mirage
de_nuke
changelevel de_nuke
de_overpass
changelevel de_overpass
de_vertigo
changelevel de_vertigo
ar_shoots
changelevel ar_shoots
ar_baggage
changelevel ar_baggage
gd_rialto
host_workshop_map 3085490518
de_safehouse
host_workshop_map 3070550406
de_lake
host_workshop_map 3219506727
de_bank
host_workshop_map 3070581293
de_shortdust
host_workshop_map 3070612859
fy_pool_day
host_workshop_map 3070923343
fy_iceworld
host_workshop_map 3070238628
daymare
host_workshop_map 3072640420
aim_theorem
host_workshop_map 3070348309
de_assembly
host_workshop_map 3071005299
de_cbble
host_workshop_map 3070212801
de_cache
host_workshop_map 3070244931
de_pipeline
host_workshop_map 3079872050
de_biome
host_workshop_map 3075706807
dm_desk
host_workshop_map 3077599381
fun_bounce
host_workshop_map 3088183343
1v1aim_map_longdustversion_d
host_workshop_map 3082605693
ar_churches_s2r
host_workshop_map 3070291913
aim_ag_texture_city_advanced
host_workshop_map 3082113929
traningoutside
host_workshop_map 3080973179
shipment_version_1_0
host_workshop_map 3086555291
aim_ag_texture2
host_workshop_map 3074961197
aim_ag_texture_jungle
host_workshop_map 3095778105
cs2_bloodstrike
host_workshop_map 3071890065
gg_simpsons_vs_flanders_v2
host_workshop_map 3109232789
de_akiba
host_workshop_map 3108513658
cs_facingworlds-99
host_workshop_map 3112806723

mg_executes

de_ancient
changelevel de_ancient
de_anubis
changelevel de_anubis
de_mirage
changelevel de_mirage
de_nuke
changelevel de_nuke

mg_gungame

ar_shoots
changelevel ar_shoots
ar_baggage
changelevel ar_baggage
fy_pool_day
host_workshop_map 3070923343
fy_iceworld
host_workshop_map 3070238628
daymare
host_workshop_map 3072640420
aim_theorem
host_workshop_map 3070348309
de_safehouse
host_workshop_map 3070550406
de_lake
host_workshop_map 3219506727
de_bank
host_workshop_map 3070581293
fun_bounce
host_workshop_map 3088183343
1v1aim_map_longdustversion_d
host_workshop_map 3082605693
ar_churches_s2r
host_workshop_map 3070291913
aim_ag_texture_city_advanced
host_workshop_map 3082113929
traningoutside
host_workshop_map 3080973179
shipment_version_1_0
host_workshop_map 3086555291
aim_ag_texture2
host_workshop_map 3074961197
aim_ag_texture_jungle
host_workshop_map 3095778105
cs2_bloodstrike
host_workshop_map 3071890065
gg_simpsons_vs_flanders_v2
host_workshop_map 3109232789

mg_hidenseek

infernohideandseek
host_workshop_map 3097563690
seek_town_bs
host_workshop_map 3074479691
winterday_bs
host_workshop_map 3070951079
minus_denhet
host_workshop_map 3070541369
hs_lake
host_workshop_map 3071094345

mg_kz

only_up
host_workshop_map 3074758439
kz_hub
host_workshop_map 3070220367
kz_checkmate
host_workshop_map 3070194623
kz_victoria
host_workshop_map 3086304337
kz_rc_stonehenge
host_workshop_map 3072219045
kz_sxb2_cxz
host_workshop_map 3083714192
kz_rc_twotowers
host_workshop_map 3083509404
kz_simplyhard
host_workshop_map 3078311932
kz_nomibo
host_workshop_map 3077122656
kz_sxb2_biewan
host_workshop_map 3076000218
kz_ggsh
host_workshop_map 3072744536
kz_ltt
host_workshop_map 3072699538
kz_grotto
host_workshop_map 3121168339
kz_igneous
host_workshop_map 3102712799

mg_minigames

mg_skeet_multigames_v7
host_workshop_map 3082120895
mg_warmcup_headshot
host_workshop_map 3076765511
deathrun_iceworld_cs2
host_workshop_map 3083325292
mg_lego_minigames
host_workshop_map 3097973183
mg_legospace_multigames
host_workshop_map 3188024686
mg_multigames_devine_is_french
host_workshop_map 3111582979
mg_wl_multigames
host_workshop_map 3156615586
mg_swag_multigames_v7_1
host_workshop_map 3101960156
mg_pudding_multigames_cs2
host_workshop_map 3242033080
mg_saw_v64_cs2
host_workshop_map 3106085501

mg_minimaps

minimirage_cs2port
host_workshop_map 3099519038
mini_train
host_workshop_map 3078140567

mg_multi1v1-arena

am_anubis_p
host_workshop_map 3242420753
am_duels_mirage
host_workshop_map 3262582924
am_garden
host_workshop_map 3179186642
am_minecraft_pierdolnik
host_workshop_map 3197575080
aim_redline_fp
host_workshop_map 3070253400
am_zen
host_workshop_map 3180965466

mg_prac

de_ancient
changelevel de_ancient
de_anubis
changelevel de_anubis
de_dust2
changelevel de_dust2
de_inferno
changelevel de_inferno
de_mirage
changelevel de_mirage
de_nuke
changelevel de_nuke
de_overpass
changelevel de_overpass
de_thera
changelevel de_thera
de_vertigo
changelevel de_vertigo
de_cbble
host_workshop_map 3070212801
de_cache
host_workshop_map 3070244931
de_season
host_workshop_map 3073892687

mg_prefire

de_ancient
changelevel de_ancient
de_anubis
changelevel de_anubis
de_dust2
changelevel de_dust2
de_inferno
changelevel de_inferno
de_mirage
changelevel de_mirage
de_nuke
changelevel de_nuke
de_overpass
changelevel de_overpass

mg_retakes

de_ancient
changelevel de_ancient
de_anubis
changelevel de_anubis
de_dust2
changelevel de_dust2
de_inferno
changelevel de_inferno
de_mirage
changelevel de_mirage
de_nuke
changelevel de_nuke
de_overpass
changelevel de_overpass
de_vertigo
changelevel de_vertigo

mg_scoutzknivez

scoutzknivez_pure_cs2
host_workshop_map 3073929825
ar_dizzy
host_workshop_map 3070553020

mg_soccer

ka_soccer_2009
host_workshop_map 3070198374
field
host_workshop_map 3238565662

mg_surf

surf_aquaflow
host_workshop_map 3255589335
surf_kitsune
host_workshop_map 3076153623
surf_utopia_njv
host_workshop_map 3073875025
surf_mesa_aether
host_workshop_map 3125360522
surf_nyx
host_workshop_map 3129698096
surf_beginner
host_workshop_map 3070321829
surf_inui
host_workshop_map 3255525511
surf_mesa_revo
host_workshop_map 3076980482
surf_deathstar
host_workshop_map 3080544577
surf_rookie
host_workshop_map 3082548297
surf_benevolent
host_workshop_map 3098972556
surf_boreas
host_workshop_map 3133346713
surf_ace
host_workshop_map 3088413071
surf_astra
host_workshop_map 3165517928

mg_wingman

cs_italy
changelevel cs_italy
cs_office
changelevel cs_office
de_vertigo
changelevel de_vertigo
de_ancient
changelevel de_ancient
de_anubis
changelevel de_anubis
de_dust2
changelevel de_dust2
de_inferno
changelevel de_inferno
de_mirage
changelevel de_mirage
de_nuke
changelevel de_nuke
de_overpass
changelevel de_overpass
de_vertigo
changelevel de_vertigo
ar_shoots
changelevel ar_shoots
ar_baggage
changelevel ar_baggage
gd_rialto
host_workshop_map 3085490518
de_lake
host_workshop_map 3219506727
de_safehouse
host_workshop_map 3070550406
de_bank
host_workshop_map 3070581293
de_shortdust
host_workshop_map 3070612859
de_assembly
host_workshop_map 3071005299
de_cbble
host_workshop_map 3070212801
de_cache
host_workshop_map 3070244931
de_pipeline
host_workshop_map 3079872050
de_biome
host_workshop_map 3075706807
mp_raid
host_workshop_map 3070346180
de_mutiny
host_workshop_map 3070766070
cs_assault
host_workshop_map 3070594412
de_ruins_d_prefab
host_workshop_map 3072352643

How do I add more bots?

By default bots are enabled in deathmatch, gungame, gungame ffa, retakes, scoutsknives and wingman.

The default is set to add 1 bot if only 1 human is in the server, and then if there is 2 or more humans there will be no bots.

You can overwrite the settings for the bots by creating a "custom file" for this file custom_bots.cfg.

If you copy custom_bots.cfg and put it in the custom_files/cfg/ directory (/home/steam/cs2/custom_files/cfg/ on default Linux setup) and you can modify it and change say bot_quota to 10 if you want 10 players at all times. When the server starts (on Linux and Windows) it will merge this file into the game cfg and it will execute every time bots.cfg executes.

You can also just login to RCON rcon_password yourpassword and use rcon bot_add_ct and rcon bot_add_t.

If you want to remove bots you use rcon bot_kick.

Failed to open libtier0.so

Failed to open libtier0.so (/home/steam/cs2/bin/libgcc_s.so.1: version 'GCC_7.0.0' not found (required by /lib/i386-linux-gnu/libstdc++.so.6))

This is because Valve ships their own copies of those libraries. As modern systems will have newer versions, you can safely delete the listed file from the server install. Do not delete the file in the system path (usually lib or lib32)*.

cd /home/steam/cs2/bin/ and rm libgcc_s.so.1 and restart the server.

How do I connect to RCON remotely?

Download SourceAdminTool (source) for your OS (you can read about it here) and click Servers > Add Servers and put in the <IP>:27015 and when you see the server show in the list, down the bottom left type in your RCON password and click Login and you should be able to execute commands from the bottom text box i.e. exec dm.cfg

You must connect to the server from the public IP if hosting an online server, not the LAN IP even if you are on the same network. The script logs the public IP Starting server on XXX.XXX.XXX.XXX:27015

Why can't I set the server to start automatically with a mod loaded

Because the way the server is setup with several mods it's not possible. You can't use +exec in the server launcher as that executes to quick before SourceMod is loaded. You can monitor the server once it's started (via RCON) and then load a mod i.e. exec dm.cfg.

Acessing admin menu

Admins are managed by CounterStrikeSharp using the Admin Framework. You define admins and their flags and most plugins now utilise this framework.

To see an example of my admins you can look at this file /custom_files_example/addons/counterstrikesharp/configs/admins.json. To set your admins on your own server use this file as a reference and use the custom files system to have your own version.

Ensure your .json files are valid JSON by using this website.

If you have added the admins correctly you should see Loaded admin data with X admins. in the server logs when it starts.

If you modify the server whilst the server is on you can run css_admins_reload to reload the admins and see the admins with css_admins_list.

Use number keys to operate menu instead of typing !1 in chat

If you don't like having to type in chat !number every time you want to use a menu item; you can use this trick to bind the corresponding !number command to the number key. So when you press 1 it will select the 1 option:

Note: This is assuming you are using the standard binds. You can change accordingly for your own setup.

bind "1" "slot1; css_1"
bind "2" "slot2; css_2"
bind "3" "slot3; css_3"
bind "4" "slot4; css_4"
bind "5" "slot5; css_5"
bind "6" "slot6; css_6"
bind "7" "slot7; css_7"
bind "8" "slot8; css_8"
bind "9" "slot9; css_9"
bind "0" "slot10; css_0"

Changing maps

Admin change map menu

Admins can type !maps in chat and it will bring up a menu of all the maps for the current mod. When a map is selected it will change the map straight away.

At the end of the map (if time runs out or win conditions are met) it a vote will show to choose a map from the current mod.

Changing settings

Admins can type !settings in chat and it will bring up a menu of all the settings you can enable or disable. i.e.: Bunnyhopping, fun mode etc.

Changing game modes

Admin change game mode menu

Admins can type !modes in chat and it will bring up a menu of all the game modes. Simply choose one and it will switch to that game mode and change to a default map for that game mode.

The maps in !maps will also update to the new game mode when it has changed.

You can also change directly to a game mode with the Rcon commands via chat i.e. !rcon exec dm will change to deathmatch.

These are all the available chat commands to change the game mode:

Command Game mode
!mode 1v1 1v1 (allows more than 2 players)
!mode aim Aim Maps
!mode awp AWP Maps
!mode ar Arms Race
!mode bhop Bunny hop maps
!mode casual Casual/Fun maps
!mode comp 10mans/scrims/match environment featuring MatchZy matchzy_autostart_mode 1
!mode course Tests players with different traps, kz, surf, bhop
!mode dm Deathmatch
!mode dm-multicfg Deathmatch Multi-CFG
!mode executes Similar to Retakes, but simulates round-play before bomb plants. Hence "Executes"
!mode gg Gun Game
!mode hns Hide n Seek
!mode kz Kreedz Climbing
!mode minigames Mini Games
!mode miniMaps Mini-style Maps (ie. mini_mirage)
!mode prac Practice environment featuring MatchZy matchzy_autostart_mode 2
!mode prefire OpenPrefirePrac (similar to Yprac or Refrag.gg)
!mode retakes Retakes
!mode scoutzknivez ScoutzKnivez
!mode soccer Soccer
!mode surf Surf
!mode wingman Wingman (allows more than 4 players)

Changing between gamemodes multiple times is not recommended, and it is better if you restart the CS2 server in-between.

To view what other commands are available view the plugins at the top of the page.

RCON doesn't work

Using RCON whilst connected to the server does not work. See discussion here. The current work arounds are:

  • I have included CS2Rcon which allows admins to use !rcon in chat.
  • You can disconnect from the server and use rcon_address IP:PORT in console and you can use rcon commands.
  • Use an external RCON program which has implemented the RCON protocol such as this.

If it still doesn't work, make sure you try connect from CS2 outside of a game via console:

You must connect to the server from the public IP if hosting an online server, not the LAN IP even if you are on the same network. The script logs the public IP Starting server on XXX.XXX.XXX.XXX:27015

rcon_address ip:port
rcon_password "password"
rcon say "hi"

And check the ports cs2 is using on your OS i.e. on Ubuntu sudo lsof -i -P -n | head -n 1; sudo lsof -i -P -n | grep cs2.

Manually updating Metamod:Source and CounterStrikeSharp

If you are on a unix based system, you can run scripts/check-updates.sh which will check the current versions of each plugin installed in this repo vs what the latest is, this makes it easier than going through each one manually.

Go to the Releases page for Metamod:Source and CounterStrikeSharp and download the latest. You need to merge the addons folder from the zips into the /game/csgo/addons of this repo. This is easy to do with unix based systems with rsync:

First open terminal and cd into the folder where you unzipped the zips i.e.: cd ~/Downloads then update the command below with the full path to the repo and run it:

rsync -rhavz --exclude "._*" --exclude ".DS_Store" --partial --progress --stats ./addons/ /Users/kus/dev/personal/counter-strike/cs2-modded-server/game/csgo/addons/

Broadcasts

If you want to disable Broadcasts on your server, unload the plugin by putting the directory /game/csgo/addons/counterstrikesharp/plugins/CS2AnnouncementBroadcaster/ in your disabled folder. If you wish for it to only be used on certain modes. Add css_plugins unload "CS2 Announcement Broadcaster" to your unload_plugins.cfg and css_plugins load "plugins/disabled/CS2AnnouncementBroadcaster/CS2AnnouncementBroadcaster.dll" in your comp.cfg (competitive 5vs5 for example).

You can also leave it in the /plugins/disabled folder and in you can put it in your /custom_files/cfg/custom_all.cfg file.

The config file is located at /game/csgo/addons/counterstrikesharp/plugins/CS2AnnouncementBroadcaster/cfg/messages.json which you would put in /custom_files/addons/counterstrikesharp/plugins/CS2AnnouncementBroadcaster/cfg/messages.json so it is not overwritten.

CS2VoiceFix

If your server experiences voice chat issues when an addon is unloaded (e.g. map changes), you might want to try enabling CS2VoiceChat. This can be done by simply moving /custom_files_example/addons/metamod/CS2VoiceFix.vdf to /custom_files/addons/metamod/CS2VoiceFix.vdf.

Using DiscordUtilities

DiscordUtilities is enabled by default. I have left it enabled as I find it useful, and relatively straight-forward to setup. Here is a setup guide for installing to your discord, along with the optional MySQL DB linking, which I recommend for administrating community-led servers. You can remove modules as you please.

RockTheVote (RTV)

RockTheVote is currently configured to only be used on modes where map extending isn't generally required (Casual, Multi1v1-Arenas, GunGame, Retakes, etc.). Currently RTV doesn't support extending map by x rounds/minutes, so modes like Surf, KZ, BHop, and other modes where time requirements are player(s) dependent, are disabled. Enable on all modes by simply adding css_plugins load "plugins/disabled/RockTheVote/RockTheVote.dll" to /custom_files/cfg/custom_all.cfg.

Enable Whitelist so only a list of people can play

If you want to enable a whitelist on your server load the plugin by putting this css_plugins load "plugins/disabled/WhiteList/WhiteList.dll" in one of your .cfg files.

If you want it to load on every mod on your server, you can put it in your /custom_files/cfg/custom_all.cfg file.

The whitelist file is located at /game/csgo/addons/counterstrikesharp/plugins/disabled/WhiteList/whitelist.txt which you would put in /custom_files/addons/counterstrikesharp/plugins/disabled/WhiteList/whitelist.txt so it is not overwritten.

License

See LICENSE for more details.