Although this article uses version 1.4, the principles of 1.5 and 1.6 are basically the same as them, so everyone can make corresponding modifications.
First you need to download two files.hlds_l_3109_full.bin cs_14_full., and then install it. First you need to unzip the file:
chmod +x hlds_l_3109_full.bin
./hlds_l_3109_full.bin
At this time, the protocol option will appear, just enter "yes" and the hlds_l_3109_full. file will be solved.
tar zxvf hlds_l_3109_full.
Release the HLDS_L directory (this is the entire directory of the server) and start installing CS1.4 mode
tar zxvf cs_14_full.
Release the cstrike directory and copy it to the HLDS_L directory (if you release the cs_14_full. file in the hlds_l directory, save the following steps)
cp -a cstrike hlds_l/
Then set the file: (The following is already done, just copy it in)
sv_cheats 0
hostname " CS'Server " //Server name
mp_timelimit 45 //Replace map time
mp_c4timer 45 // Countdown time
mp_chasecam 0 // Whether to fix the lens
(If you choose 1, you can only watch the game at a fixed location after entering the server, otherwise those who have not joined the team can watch it freely)
mp_falldamage 1 // Killing damage from a high place
mp_flashlight 1 // Is there any tactical flashlight
mp_footsteps 1 //Is there any footsteps
mp_freezetime 4 // Start buying items in each game
mp_friendly_grenade_damage 1 //Is the grenade friendly injured?
mp_friendlyfire 0 // Is it harmed by friendly forces
mp_autoteambalance 2 //Automatically adjust the minimum limit on the number of people between the two parties
mp_roundtime 4 //Maximum number of time per turn
rcon_password **** // Server password, * part is set for yourself
mp_limitteams 2 // If both parties exceed N, they will automatically adjust, N is the number
mp_tkpunish 1 // whether to hurt friendly forces and punish them
mp_mapvoteratio 0.2 // Voting ratio
mp_logfile 1 //Whether the server leaves a record file
log on //start logging
mp_playerid 0
//For everyone, you can see everyone's name in the status bar;
1 means you can only see your own name; 2 means you can't see anyone's name;
0 is the default.
mp_fadetoblack 0 // The screen turns black after the character dies, and 0 is unchanged. 0 is the default.
mp_forcechasecam 0 // You can watch it at will after death, 1 can view your own people, and 2 can view the camera angle. 0 is the default.
mp_buytime 90 // Items can be purchased,
For example, if mp_buytime 1.8 is 108 seconds, you can buy it.
1.5 minutes is the default.
mp_winlimit 17 // Change the map when the number of victories on a certain side reaches 17 times.
allow_spectators 1 // Allow observer angle, 0 is not allowed, 1 is allowed. 1 is the default.
mp_hostagepenalty 3 // More than three people injured in the specified time will be kicked out automatically
cl_dynamiccrosshair 0 // Whether to use dynamic sight, 0 is not allowed, 1 is allowed. The default is 0.
mp_logmessages 1 // Open log
Download and install the latest server patch, currently 3.1.0.9c. The installation method is basically the same as above. After expanding, it will be directly overwritten. What you need to do now is to create a shortcut file to start the server, otherwise you have to enter a large piece of command every time, which is too troublesome.
Enter the hlds_l directory to create a quick startup file CS, open the editor, any kind of it is OK, such as pico
pico cs
enter
#/bin/bash/
./hlds_run -restart -game cstrike +port 27020 +maxplayers 20 +map de_inferno
Save and exit
-restart parameter plays the role of automatically restarting when the cs server process is fired. Speaking of this, I remember something. A friend I just met made a linux server process monitoring program (it is estimated that other games or software can be used). In addition to the functions I mentioned above, it can also prevent malicious shutdown (such as others obtain your op password or OP accidentally enters exit to shut down the server).
I have tested it. Whether I use the op password to enter exit to close the server, or kill all the CS processes on the server, it will automatically restart the server process. Unless you kill this monitoring program, if you can kill this program, your server will probably lose control, and ordinary people will not be so bored to close the process by themselves!
The shortcut file has been established now, but it cannot be run yet. Enter chmod +x cs to modify the properties of the shortcut startup file (or it cannot be run)
Now that the task is done, enter ./cs& in the hlds_l directory to start the cs server. Remember to add the & parameters, otherwise the cs server process will automatically close when you exit the system.