Counter-Strike 2

Counter-Strike 2

Pas assez d'évaluations
Script to run CS2 server on a dedicated server or VPS
De evil /> @ SRCDS.pro
A guide to running a CS2 server on your own machine.
   
Récompenser
Ajouter aux favoris
Favoris
Retirer des favoris
General Information
The SRCDS.pro script is designed to facilitate the management of a Counter-Strike 2 server on dedicated servers or VPS.



Main features
  • Installing the serve (SteamCMD)
  • Server update (SteamCMD)
  • Reinstalling the server (SteamCMD)
  • Uninstalling the server
  • Start/Stop/Restart the server
  • Server Console
  • Server monitoring
Systems support
  • Debian 11 or newer
  • Ubuntu 20.04 or newer
Recommended system requirements
  • CPU: minim x86-64-v2 (with popcnt)
  • Minimum RAM: 2GB
  • Storage: 40GB
  • Requires Glibc 2.31
Preparing the environment
Before we download and use the script, we need to prepare the working environment.

Debian users only
Enable 'sudo' on an user account on Debian
At first, login to an user account and open a terminal to execute the following commands:
1. Log in to the root account using the su command and enter the root password
2. Now, install sudo with apt-get install sudo

Do it no matter what system
It's best to do this from root
1. Create an additional account on your machine, it's best to do this from root. If you already have an account other than root and want to use it, skip this step. FOR SAFETY NEVER RUN ANY SCRIPTS ON THE ROOT ACCOUNT
adduser cs2ds
2. Then we assign the account we created to the sudo group. Execute this command from root. ("cs2ds" stands for the name of the user created in the step above)
/sbin/adduser cs2ds sudo
3. Now log in to the account we created earlier. ("cs2ds" stands for the name of the user created in the step above)
su -l cs2ds
This completes the account preparation phase

Required packages for the proper operation of CS2 servers and the script
Install the following packages for your systems. The script should inform you about missing packages and will suggest installing the missing packages.
The script is in the testing phase and something may not work, so below is information about which packages should be installed.
Debian 11 or newer
sudo apt update && sudo apt install -y screen tar wget ca-certificates libc6 libgcc-s1 libc6-i386 libgcc-s1 lib32gcc-s1
Ubuntu 20.04 or newer
sudo apt update && sudo apt install -y screen tar wget ca-certificates libc6 libc6-i386 libgcc-s1 lib32gcc-s1
Download and prepare the script
1. Download the script using the command given below:
2. Add execute permission for script file
chmod +x cs2_server_27015
3. Editing script settings to do this, enter the following command
nano cs2_server_27015
For the script to work properly, please do not edit these values. The game server port and CSTV are established there. How to change the server port will be written below.

Go to the "Server parameter settings" section
Here we set parameters such as server IP, map, etc
  • IP - Set the IP address on which the Counter-Strike 2 server will be running
  • MP - Specify the maximum number of players that will be able to connect to the server.
  • CSTV - CSTV enable = 1 / disable = 0 (Disable by default)
  • SVLOG - Enabling logs on the Counter-Strike 2 server. enable = 1 / disable = 0 (Enabled by default)
  • LAN - Set whether a server is a LAN server or not. (Disable by default)
  • MAP - Set the starting map
  • GSLT - Manage your steam tokens https://gtm.steamproxy.vip/dev/managegameservers
  • CFG - Server configuration file. There you set the server name, password and rcon password
  • MG - Set the configuration of game type and mode based on game alias like 'competitive'
    • competitive <- sets both game mode and game type commands: game_mode 1, game_type 0
    • wingman <- sets both game mode and game type commands: game_mode 2, game_type 0
    • casual <- sets both game mode and game type commands: game_mode 0, game_type 0
    • deathmatch <- sets both game mode and game type commands: game_mode 2, game_type 1
    • armsrace <- sets both game mode and game type commands: game_mode 0, game_type 1
    • custom <- sets both game mode and game type commands: game_mode 0, game_type 3
4. Changing the port of the game server and CSTV.
As you may have noticed, the script name "cs2_server_27015" contains the port. To change the game server port you need to change the name of the script. The CSTV port is always set to +1000 to the game server port. Which means that if the game server port is set to e.g. 27022, the CSTV port will be set to 28022. With more servers, this helps with control.

  • To change the server port before installing it, go to the directory where the script is located and run the following command.
    mv cs2_server_27015 cs2_server_27016
    This will change the game server port to 27016 and CSTV to 28016

  • To change the server port after installation, go to the directory where the script is located and execute the following two commands
    mv cs2_server_27015 cs2_server_27016 && mv CS2DS_27015 CS2DS_27016
    There are server files in the CS2DS_27015 directory. To avoid the need to reinstall the server, you also need to change its name to the port that you changed the script.

  • To be able to run several servers before installing them, create a copy of the script file with a changed port name. You can do this with the command below.
    cp cs2_server_27015 cs2_server_27016
    At this point we have two scripts that support two servers, one with port 27015 and the other 27016.
    Remember that each server must have its own GSLT token

  • To be able to run several servers after installing the first server, create a copy of the script file and the contents of the server directory with a changed port in the name.
    cp cs2_server_27015 cs2_server_27016 && cp -r CS2DS_27015 CS2DS_27016
    Copying the server may take a while because it is about 40GB
Running the script and its functions
All available script options are shown in the screenshot below, but the available options are displayed according to the server status.
Available options:
i - Server installation
u - Server update
r - Server reinstalling
d - Server uninstalling

s - Start server
c - Start server + console

1 - Console
2 - Server status
3 - Restart server
4 - Stop server

x - Closing the script



Running the script
We run the script and manage the server. We run the script with the following command:
./cs2_server_27015

Before installing the server
When running the script for the first time or if the server is not installed, only the server installation option will be displayed in the menu. To start the server installation, press the letter "i" on the keyboard and confirm with enter.


After server installation
After installing the server, the following options will be available


After starting the server
After starting the server, the following options are available
Additional information
Please report errors and comments in the steam discussion HERE
Tip
To manage the server via RCON without additional programs, you can use CS2 Web RCON Console which you run in the Steam browser
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=3307875667
3 commentaires
Murilove 7 déc. 2024 à 17h42 
If I had two asses, one would be yours. thank u bro.
Bukoooo 22 aout 2024 à 14h27 
good job :D
К 22 aout 2024 à 13h26 
суба брат