Left 4 Dead 2
Оцінок: 63
L4D2: How to Host your Own Dedicated Server to Allow More Than Four Human Players in Campaign (still working in 2024)
Автор: Hozone5
This guide serves to provide a relatively simple procedure as to exactly how one should establish their own dedicated server to allow more than four human players in Campaign, Left 4 Dead 2. This guide also serves as a 2020 post-Last Stand update for complete beginners regarding essentially everything you need to know on the topic of dedicated server hosting and management. Carefully follow all the necessary steps and you will succeed.
   
Нагородити
До улюбленого
В улюблених
Прибрати
Source Engine Server Files
The files for your dedicated server itself. It is crucial to install these files. Download the server files in accordance to your operating system:

Windows.
Linux.

This guide assumes you are using only one drive for your server (e.g. the C:\ drive). Create a new folder; its location is irrelevant. Name it something simple such as “MYODS”. For the purpose of this guide, the file path for the server will be as follows: “C:\MYODS”. Place "MYODS" in your C:\ drive immediately. Create another folder titled “SteamCMD” and place it in your C:\ drive as well. For the sake of simplicity, your "SteamCMD" folder should now be in the same location as your "MYODS" folder.

Once you have downloaded the respective "SteamCMD" .zip file, extract “steamcmd.exe” from the downloaded .zip file to “C:\SteamCMD”. Run “steamcmd.exe”. You should now see a new window with a black background and a significant amount of white text. Wait for the files to finish installing. After the installation has completed, you should see a new line that appears as follows:

Steam >

Input the following command into the prompt such that the line appears as follows:

Steam > login anonymous

Press the "Enter" key on your keyboard. Input the next series of commands in the same manner as the previous, pressing "Enter" after each respectively:

force_install_dir C:\MYODS app_update 222860

When you see the line "Success! App '222860' fully installed", input the final command:

quit

The window should have closed itself.

Navigate to “C:\MYODS”. You should now see almost the exact same files and folders you would normally see in your L4D2 client-side “C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2” folder.
Port Forwarding
Port forwarding allows outside connections (i.e. other users) the ability to join your dedicated server. Skipping this step means other players most likely will not be able to connect to your server.

Essentially, at least what I did was I logged in to my network’s gateway, navigated to the port forwarding section of my network, and added a new port. Name the port name to whatever you wish. Name the port number to whatever you wish, preferably something as simple as '1'. The protocol should be UDP. The LAN Host should be the IP of your machine in which you are running your dedicated server on. For the WAN Port range, I used the boundaries 27000 to 27050 respectively. For the range of the LAN Host Port, I set the boundaries to 27000 to 27050 respectively as well. Save the settings for the port and log out of your network’s gateway. The following images are examples of the port forwarding page of a LinkSys router and a DD-WRT router respectively:





Every router has their own unique way of accessing its gateway and thus, its port forwarding page. The process and format to do so is generally the same for all router brands. There are countless guides on the web should you not know how to log in to your network’s gateway. There are also just as many guides on the web regarding port forwarding. In the past, perhaps fourteen years ago, port forwarding may have been somewhat difficult. Nowadays, the general process for port forwarding is only becoming easier and simpler.

In summary, if you do not open your ports on your router by port forwarding, nobody will be able to connect to your server except you, regardless of whether or not you have followed this guide correctly.

Click here[portforward.com] to search for your router's model and the model-specific instructions on how to port forward.
SourceMod and MetaMod
SourceMod, MetaMod, and the specific plugins and extensions alike that arrive with it are what allows more than four human players on your server, assuming you are running your server on Campaign mode. This guide should function for the Versus, Survival, and Mutation modes as well (e.g. more than eight human players in total for Versus). For instance, if you were starting your server on a survival-exclusive map, you would need to change the "sm_cvar mp_gamemode" configuration variable found within your server.cfg file to "survival".

Download the latest versions of SourceMod[www.sourcemod.net] and MetaMod.[www.sourcemm.net]

Extract the contents of the SourceMod .zip file to "C:\MYODS\left4dead2". If there is a prompt asking whether if you would like to replace any files, select "Yes". The "addons" folder should now contain the "metamod" and "sourcemod" folders. There should now be a "sourcemod" folder in your "cfg" folder as well (i.e. "C\:MYODS\left4dead2\cfg"). Extract the contents of the MetaMod .zip file to "C:\MYODS\left4dead2". Select "Yes" if there is a prompt asking you to replace any files. You should now see a "metamod.vdf" within your "addons" folder. The following image is an example of what the "C\:MYODS\left4dead2\addons" of your server directory should look like after all the previous steps:



As for the plugins, I highly suggest you use the list of essential plugins and other similar extensions that I am currently using in my own dedicated server to ensure there is as little error and bugs as possible. They include the following:

Bebop.[forums.alliedmods.net]
Left 4 Downtown 2 (download the first .zip attachment in the post).[forums.alliedmods.net]
L4DToolz.[forums.alliedmods.net]
ABM (download both the .txt and .smx files attached in the post).[forums.alliedmods.net]
mi1234645's 4+ Survivor AFK Fix.[forums.alliedmods.net]
Spirit_12's Defibrillator Bug Fix.[github.com]
Spirit_12's 8+ Players Bug Fixes.[github.com]
Merudo's Save Weapon Fork.[forums.alliedmods.net]
Merudo's Survivor Identity Fix for 5+ Survivors (download both the .txt and .smx files attached in the post).[forums.alliedmods.net]
Peace-Maker's Detour-Supported DHooks (download the first .zip attachment in the post).[forums.alliedmods.net]

The majority of the listed plugins and extensions hold the actual files themselves at the bottom of the author's release post. A few plugins such as mi123645's 4+ Survivor AFK Fix requires you to install multiple files into your server directory, i.e. a .smx and a .txt file. In this example, you would scroll down to the "Attached Files" section of the post and click on the "Get Plugin" link to download the .smx file and the "l4dafkfix.txt" link to download the .txt file. Every plugin is unique. Read the installation instructions on each author's post carefully and ensure you are downloading and installing the correct files to the correct location within your server directory.

.smx files (except "dhooks-test.smx") go in "C:\MYODS\left4dead2\addons\sourcemod\plugins".
.ext files go in "C:\MYODS\left4dead2\addons\sourcemod\extensions".
.txt files go in "C:\MYODS\left4dead2\addons\sourcemod\gamedata".
.sp files go in "C:\MYODS\left4dead2\addons\sourcemod\scripting".
.dll files go in "C:\MYODS\left4dead2\addons\sourcemod\extensions".
.so files go in "C:\MYODS\left4dead2\addons\sourcemod\extensions".
.autoload files go in "C:\MYODS\left4dead2\addons\sourcemod\extensions".
.inc files go in "C:\MYODS\left4dead2\addons\sourcemod\scripting\include".

Credits for the plugins and extensions themselves, of course, go to all the respective creators in the aforementioned list of plugins and extensions.

Referring specifically to the L4DToolz plugin, after downloading the L4DToolz .zip file, extract the contents to "C:\MYODS\left4dead2\addons". If asked to replace files, select "Yes".

Now that you have installed SourceMod and MetaMod, you should add yourself as a SourceMod admin to your server so that you have all the basic SourceMod admin permissions should there be malevolent players in your server.

Navigate to C:\MYODS\left4dead2\addons\sourcemod\configs and open the "admins_simple.ini" file. At the very bottom of the file (i.e. after the final line of forward slashes), add a new separate line and use the following format:

"STEAM_X:X:XXXXXXXX" "99:z"

"X:X:XXXXXXXX" should be replaced with your Steam ID (not to be confused with your steamID3 and your steamID64, the latter of which is often a slightly longer string of numbers). Use https://steamid.io to find your Steam ID. You may also input "status" into your server's command prompt window (or if you are feeling particularly fancy, this is technically called the "command line interface," i.e. the CLI) or into the developer console whenever you are in-game in your server to find your Steam ID and the Steam IDs of all human users within your server at any time. To enable the in-game developer console, select "Options" in the main menu screen of L4D2, select "Keyboard/Mouse", then set "Allow Developer Console" to "Enabled". Click "Done". The developer console can be opened in-game at any time by pressing the tilde/grave key, which is usually directly under the "Esc" key on a standard English keyboard. The bottom of your "admins_simple.ini" file should now appear similar to the following:

//////////////////////////////// // Examples: (do not put // in front of real lines, as // means 'comment') // // "STEAM_0:1:16" "bce" //generic, kick, unban for this steam ID, no immunity // "!127.0.0.1" "99:z" //all permissions for this ip, immunity value is 99 // "BAILOPAN" "abc" "Gab3n" //name BAILOPAN, password "Gab3n": gets reservation, generic, kick // //////////////////////////////// "STEAM_X:X:XXXXXXXX" "99:z"

The amount of space between "STEAM_X:X:XXXXXXXX" and "99:z" should be the equivalent to the amount of space from pressing the "tab" key on your keyboard twice. The "tab" key is usually directly above the "Caps Lock" key on most standard English keyboards.

Once you have given SourceMod admin permissions to yourself, save the file and close it. When adding other users as SourceMod admins to your server, repeat this process.

Of course, you are not limited to my list of recommended plugins and extensions. You may implement additional modifications to your server as you wish. Browse through SourceMod L4D2 plugins here.[www.sourcemod.net]
Eight Survivor Integration
This section is entirely optional.

By default, without any plugins, additional survivors in L4D2 survivor campaigns will be duplicates of the L4D2 survivors and additional survivors in L4D1 survivor campaigns will be duplicates of the L4D1 survivors (e.g. in a L4D2 survivor campaign, there could be two Nicks and two Coaches but not any L4D1 survivors). Furthermore, the L4D2 survivor voice lines on L4D1 survivor campaigns do not function. However, on L4D2 survivor campaigns, the L4D1 survivor voice lines do in fact function, with the exception of Zoey.

Zoey's voice lines do not function on L4D2 survivor campaigns because according to Valve, she does not exist in almost all the L4D2 survivor campaigns besides The Passing. In contrast, voice lines for Bill, Francis, and Louis all function normally on L4D2 survivor campaigns.

Her existence on L4D2 survivor campaigns is also prone to crash your server on L4D2 survivor campaigns. Silvers's Real Zoey Unlock plugin fixes this issue.

Additionally, please keep in mind that on L4D1 survivor campaigns, the survivor HUD icons and the first person view models of the L4D2 survivors do not appear; you will only see the arms, hands , and survivor HUD icons of the respective L4D1 survivors. However, on L4D2 survivor campaigns, you will see the first person view models and the survivor HUD icons of all four L4D1 survivors as you normally would on L4D1 survivor campaigns, with the exception of Zoey once again.

If you wish to have all eight survivors (i.e. both L4D1 and L4D2 survivors) on all campaigns such that the first eight survivors are all unique (i.e. any additional survivors after the first eight will be duplicates), regardless of whether a particular campaign is a L4D2 survivor campaign or a L4D1 survivor campaign, download and install the following:

Silvers's Real Zoey Unlock (download "l4d2_zoey_unlock.txt" and click on "Get Plugin).[forums.alliedmods.net]
8 Player Vocalization Files Fix (download the first attached file, extract the .vpk file to your "C:\MYODS\left4dead2\addons" folder).[forums.alliedmods.net]
L4D2 Survivors on L4D1 Campaign Fix (on the third attached file, click "Get Plugin"). [forums.alliedmods.net]

.smx files go in "C:\MYODS\left4dead2\addons\sourcemod\plugins".
.ext files go in "C:\MYODS\left4dead2\addons\sourcemod\extensions".
.txt files go in "C:\MYODS\left4dead2\addons\sourcemod\gamedata".
.sp files go in "C:\MYODS\left4dead2\addons\sourcemod\scripting".
.dll files go in "C:\MYODS\left4dead2\addons\sourcemod\extensions".
.so files go in "C:\MYODS\left4dead2\addons\sourcemod\extensions".
.autoload files go in "C:\MYODS\left4dead2\addons\sourcemod\extensions".
.inc files go in "C:\MYODS\left4dead2\addons\sourcemod\scripting\include".

Credits for the aforementioned list of plugins and extensions go to their respective creators.

After having properly installed the above list of optional plugins and extensions, your server should now by default permit all eight survivors in any campaign.

From here, proceed through this guide until you reach the "List of Helpful In-Game Commands" section.
server.cfg
The server.cfg file is home to the settings (i.e. configuration variables and commands) of your dedicated server. Navigate to “C:\MYODS\left4dead2\cfg” and create a new text document. Name it “server.cfg”. The following is an example of a basic server.cfg file. I strongly suggest you copy and paste all of the following into your server.cfg file:

// You should change these hostname "Your Server Name Here" rcon_password yourpass // This states how players should contact you. Use your email or website sv_contact your@email.com // Number of rounds to play (only versus) mp_roundlimit 2 // If you want to use a search key to find the server in the lobby, uncomment and edit this line sv_search_key "" sv_tags "" // STEAM GROUP sv_steamgroup GROUPIDHERE //MASTERSERVERS //FRIENDLY FIRE sm_cvar survivor_friendly_fire_factor_easy 0 sm_cvar survivor_friendly_fire_factor_expert 0 sm_cvar survivor_friendly_fire_factor_hard 1 sm_cvar survivor_friendly_fire_factor_normal 1 // CHEAT/CONFIG sv_lan 0 sv_cheats 0 sv_maxcmdrate 101 sv_maxrate 30000 sm_cvar sv_disable_glow_survivors 0 sm_cvar sv_disable_glow_faritems 0 sm_cvar sv_rescue_disabled 0 //ADVERTISEMENTS sm_advertisements_enabled 1 sm_advertisements_interval 480 //MOTD motd_enabled 1 //GAME MODE sv_gametypes "coop, versus, mutation" sm_cvar mp_gamemode coop //DIFFICULTY z_difficulty Impossible //LOBBY CONNECT sv_allow_lobby_connect_only 0 //--> Region - This sets the lobby in which your server will be part of //--> You will want to set this to the closest location to your server //--> eastcoast - sv_region 0 //--> westcoast - sv_region 1 //--> south america - sv_region 2 //--> europe - sv_region 3 //--> asia - sv_region 4 //--> australia - sv_region 5 //--> middle east - sv_region 6 //--> africa - sv_region 7 //--> world - sv_region 255 //sv_region 255 //BEBOP, L4DToolz, and Left 4 Downtown 2 sm_cvar l4d_maxplayers "8" //from Left 4 Downtown 2 Extension sm_cvar l4d_survivor_limit "8" //from Left 4 Downtown 2 Extension sm_cvar sv_maxplayers "8" sm_cvar sv_visiblemaxplayers "-1" sm_cvar sv_force_unreserved "1" sm_cvar sv_removehumanlimit "1" //PIPE-BOMB DURATION sm_cvar pipe_bomb_timer_duration "10" ///////////////////////// //Game Settings //////////// mp_disable_autokick 1 //(command)prevents a userid from being auto-kicked (Usage mp_diable_autokick ) sv_allow_wait_command 0 //default 1; Allow or disalow the wait command on clients connected to this server. sv_alternateticks 0 //defulat 0; (singleplayer)If set, server only simulates entities on even numbered ticks. sv_clearhinthistory 0 //(command)Clear memory of server side hint displayed to the player. sv_consistency 0 //default 1; Whether the server enforces file consistency for critical files sv_pausable 0 //default 0; is the server pausable sv_forcepreload 1 //default 0; Force server side preloading sv_pure_kick_clients 0 //default 1; If set to 1, the server will kick clients with mismatchng files. Otherwise, it will issue a warning to the client. sv_pure 0 //If set to 1, server will force all client files execpt whitelisted ones (in pure_server_whitelist.txt) to match server's files. //If set to 2, the server will force all clietn files to come from steam and not load pure_server_whilelist.txt. Set to 0 for disabled. ///////////////////////// //communication //////////// sv_voiceenable 1 //default 1; enable/disable voice comm sv_alltalk 1 //default 0; Players can hear all other players' voice communication, no team restrictions ///////////////////////// //LOGGING //////////// log on //Creates a logfile (on | off) sv_logecho 0 //default 0; Echo log information to the console. sv_logfile 1 //default 1; Log server information in the log file. sv_log_onefile 0 //default 0; Log server information to only one file. sv_logbans 1 //default 0;Log server bans in the server logs. sv_logflush 0 //default 0; Flush the log files to disk on each write (slow). sv_logsdir logs //Folder in the game directory where server logs will be stored. ///////////////////////// //Bans // execute banned.cfgs at server start. Optimally at launch commandline. // Put writeip/wrtieid commands in the bottom of server.cfg AFTER banned.cfgs have loaded. //////////// exec banned_user.cfg //loads banned users' ids exec banned_ip.cfg //loads banned users' ips writeip //Save the ban list to banned_ip.cfg. writeid //Wrties a list of permanently-banned user IDs to banned_user.cfg. ///////////////////////// //Network Tweaks - Increase network performance //////////// rate 10000 //default 10000; Max bytes/sec the host can recieve data sv_minrate 15000 //default "5000"; Min bandwidth rate allowed on server, 0 = unlimited sv_maxrate 30000 //default "0"; Max bandwidth rate allowed on server, 0 = unlimited sv_mincmdrate 20 //default 0; This sets the minimum value for cl_cmdrate. 0 = unlimited [cevo=67] sv_maxcmdrate 33 //default 40; (If sv_mincmdrate is > 0), this sets the maximum value for cl_cmdrate. [cevo=101]

This next part in particular is extremely important so pay close attention. In your server.cfg file, ensure that the following configuration variables are set to the following values:

hostname "The Name of your Dedicated Server Goes Between These Quotations Marks" sm_cvar mp_gamemode coop sv_lan 0 sm_cvar l4d_maxplayers "16" sm_cvar l4d_survivor_limit "16" sm_cvar sv_maxplayers "16" sm_cvar sv_visiblemaxplayers "-1" sm_cvar sv_force_unreserved "1"

Set the "hostname" parameter to whatever you wish. This is the public server name other users would see should they browse through a list of active servers. "sv_lan" should always be set to zero. "sm_cvar l4d_maxplayers", "sm_cvar l4d_survivor_limit", and "sm_cvar sv_maxplayers" should be set to any value above four, but preferably, below twenty-four. In this case, setting them to sixteen means that your server, hosted on Campaign (co-op) mode, would have a limit of sixteen total human players.

I personally set the values of those three configuration variables for my own dedicated server to sixteen to ensure that there always will be enough room for players. Although, unless you have fifteen friends who each have L4D2 installed and are all willing to play together at the same time in your dedicated server, you most likely will never witness that many individuals in your server.

You may be wondering why there is an influx of forward slashes in the example server.cfg file. For instance:

// This states how players should contact you. Use your email or website sv_contact your@email.com

The two forward slashes tells your server to ignore everything directly behind those two forward slashes on that specific line but it will not ignore anything directly in front of said two forward slashes on said specific line. In this case, the server will ignore "This states how players should contact you. Use your email or website" because it is behind two forward slashes. "sv_contact your@email.com" will not be ignored because it is not commented behind two forward slashes.

Of course, you may incorporate edits to your server.cfg file as you wish.
Launching your Dedicated Server
Ensure "-insecure" is not a parameter within your client-side L4D2 launch options. You will not be able to connect to your server if you have "-insecure" included as a launch option parameter. You can view your current launch options by right clicking on the L4D2 icon in your Steam Library, selecting "Properties", and selecting "Set Launch Options".

On your desktop, right click on anywhere but an icon and create a shortcut. When asked for the location of the item, browse to “C:\MYODS” and select the “srcds.exe” file. Once you have created your shortcut, right click on your shortcut and select “Properties”. In the “Target” field, input the following:

C:\MYODS\srcds.exe -console -game left4dead2 +map c1m1_hotel

Click "Apply", then click "OK". Rename the shortcut to whatever you wish. You are able to start your server on any map of any campaign, including maps from custom campaigns on the Steam Workshop, gamemaps.com, and so forth. Refer to the "Custom Campaigns" section of this guide for more details.

First, launch L4D2 as you normally would through your Steam Library, through a L4D2 application shortcut on your desktop, or through the Start menu if your computer is running the Windows 10 operating system.

Then, launch your server by double-clicking the shortcut you created earlier on your desktop. You should see a black-background command prompt window with lines of white text appear. Wait until you see the following lines:

Connection to Steam servers successful. VAC secure mode is activated

As long as your dedicated server command prompt window is running on your computer, your server will remain available for other users to join. Even if you are not connected to your own server via your client, i.e. the server has zero human players on it, other players are still able to connect to your server.

Return to your client-side L4D2 and click on "Steam Group Servers" on the main menu of L4D2. Find your server. The name of your server is what you have set the "hostname" parameter to in your server.cfg file. Your server should be at or near the top of the list of all servers on the Steam Group Servers page. Join it. Once you are in your own server, open the developer console. Input the following:

status

In the "udp/ip:" field, you should see two unique IP addresses. The IP address listed in the format "[ public IPADDRESS:PORTIP ]" is the IP address you will be providing for other users to connect to your server. This should be the primary method in how other players connect to your server. Tell them to connect to your server by typing the following into their developer console:

connect IPADDRESS:PORTIP

You are also able to connect to your own server using this method as opposed to the Steam Group Servers page. The reason why you need to launch your L4D2 game client first before your dedicated server shortcut is because you will not be able to join your own server if you launch your server shortcut first. Steam treats your server's command prompt window the same as your game client. Hence, your Steam client will not allow you to launch your game client if you launched your server shortcut first and it will yield a message stating that L4D2 is already running.

This may or may not be applicable, but your in-game client's L4D2 "Steam Group Servers" section may display an absolutely absurd number of servers that may perhaps be affiliated with a particular country of a particular ideology, or even more simply, servers associated with a rather obscene nature. For example:


Did you know that by clicking on the "Follow" button on any game's store page, you automatically join that game's official Steam group? These "Steam group leechers" are commonly due to the games you follow on Steam. The simple solution here to get rid of those servers from cluttering up your page is to unfollow as many games as possible on Steam (directly from each game's store page). You can find your list of followed games in your profile's "Games" tab:










If you have followed this guide carefully and performed every step correctly, more than four human players should be able to join your dedicated server with relative ease.

N.B. that the port of your IP address may change spontaneously on a periodic basis (e.g. the port may change from 27015 to 27016, and from 27016 to 27015). You have no control over this spontaneous change. Always type "status" into your server's command prompt window or the in-game developer console to ensure you are providing the correct IP address and port for your friends to avoid potential confusion.

To verify if you have installed all the plugins and extensions correctly, i.e. for both SourceMod and MetaMod, input the following commands into the developer console or your server's command prompt window:

sm plugins list meta list

If a list of the plugins and extensions you installed appears, you have correctly installed them into your server. If you notice the words "Unknown command" among the lines after you have inputted the two aforementioned commands, then you have most likely improperly installed the files to your server directory. Commands such as "status", "sm plugins list", and "meta list" function not only in your in-game developer console, but in your server's command prompt window as well. Input them as you normally would if you were using the developer console.

Once you have verified the functionality of your server by joining it in-game, close your L4D2 game client and close your server's command prompt window. Navigate to "C:\MYODS\left4dead2\cfg\sourcemod". Open "abm.cfg". This file should have been automatically generated after you have joined your server for the first time. I highly suggest you set the following ABM plugin configuration variables (often abbreviated to "cvar") to the following arguments:

abm_consumable "pain_pills" abm_healitem "first_aid_kit" abm_joinmenu "0" abm_teamlimit "16"

"abm_healitem" set to "first_aid_kit" ensures that all survivors, including any additional ones that are created as human players join your server, will possess first aid kits in their inventory by default. This concept applies to pain pills as well with the "abm_consumable" configuration variable. By default, anyone who joins your server will be presented with the ABM team selection menu. "abm_joinmenu" set to "0" ensures that only SourceMod admins will see this menu upon joining your server. To remain consistent with the "server.cfg" section of this guide, sixteen is the value for "abm_teamlimit". This value should be the same as whatever values you used for the three notable configuration variables mentioned in the "server.cfg" section of this guide.
List of Helpful In-Game Commands
If you have installed all of my recommended essential plugins and extensions to your server, these commands should all function without error when typed into the developer console directly in-game whilst you are in your server:

sm_admin (opens the SourceMod admin menu. Basic server administrative actions can be found in this menu such as kicking and banning other users from your server.) jointeam 2 coach (if you are already in your server and if another user joins your server, but said other user is stuck on the spectator team, tell them to input this into the developer console and they will take over the Coach bot if the Coach bot is not already occupied by another human player. Replace "coach" with any available survivor bot.) abm (opens the main menu of the ABM plugin.) abm-join (opens the ABM team selection menu.) abm-takeover (opens the ABM takeover menu that allows you to switch to another present survivor bot.) abm-model (opens the ABM survivor model selection menu, allowing you to change your current survivor's model to any survivor model without switching to another survivor bot. Voice lines for the new model you changed to will still function, with the exception of Zoey on L4D2 survivor campaigns.) abm-cycle (cycle another user or yourself through the survivor bots.) abm-mk 1 2 (adds one additional survivor bot. The first argument is the number of survivors; the second argument is the team ID. In this case, the "2" is the team ID for the survivor team.) abm-rm 1 2 (removes one survivor bot. The arguments are the same as "abm-mk".) abm-reset (should only be used in emergencies, e.g. when the ABM menus do not appear.) kick John (kicks a player with the username "John" from your server. Replace "John" with John's User ID to kick him by his User ID.) addip 50 IP (bans a user by their IP address for fifty minutes. Replacing "50" with "0" is a permanent ban. The "IP" argument is the user's IP address.) banid 50 SteamID (bans a user by their Steam ID for fifty minutes. Replacing "50" with "0" is a permanent ban. The "SteamID" argument is the user's Steam ID, which can be found by typing "status" into the developer console or your server's command prompt window.) dropclient UserID (kicks a user by their User ID. Input "users" into the developer console for a complete list of the User IDs of all players on your server.) listid (lists all SteamIDs in your server's ban list.) listip (lists all IP addresses in your server's ban list.) changelevel c1m2_streets (changes your running server to the second chapter of Dead Center. Input a single asterisk into the developer console for a complete list of map names.) info SteamID (displays information on a specific player's Steam ID.)

If you have followed the "Eight Survivor Integration" section of this guide, the above commands may be useful as well, especially "abm-model". If you wish to have a certain number of total survivors spawn into any new map by default, navigate to your "C:\MYODS\left4dead2\cfg\sourcemod\abm.cfg" file and change the following configuration variables to the following values:

abm_extraplayers "4" abm_minplayers "4"

In this example, upon loading a new map in your server, there will be a total of eight survivors including yourself, all unique, assuming that you have followed the "Eight Survivor Integration" section of this guide.

In order to easily access the SourceMod admin menu in-game, you should bind it to a key. For instance:

bind o sm_admin

For a complete list of commands and configuration variables specific to the ABM plugin, click here.[gitlab.com]

Any commands with the "sm_" prefix can be used in the in-game chat as opposed to the in-game developer console. For instance, the same menu of "sm_admin" can be opened by typing in the in-game chat "!admin". You are also able to hide your commands (e.g. !admin) such that other users will not see your message appear in the in-game chat by replacing the exclamation mark with a forward slash:

/admin

Others users would not see this if you sent this command in the in-game chat. This method functions for any command that can be replaced with the exclamation mark prefix as well.

Commands specific to the ABM plugin such as "abm" or "abm-takeover" can be used via the in-game chat as well. For instance, typing "!abm" in the in-game chat would open the same main ABM menu as an alternative to opening the developer console and typing "abm". This process applies to the "abm-takeover" command as well; it would be "!abm-takeover".

Please note that a few plugin commands, when inputted into the in-game developer console, such as "abm-mk 1 2" will yield a line that includes the words "Unknown command" even if you have indeed installed the respective plugins correctly. The command will still function normally. This is a mere error on behalf of the developer console as it sometimes cannot differentiate between a SourceMod plugin command and a native official command.
Custom Campaigns
Launching custom campaigns on your dedicated server is quite simple. First, you need to install a program called GCFScape. It is required in order to obtain the map command parameters, i.e. the name of the map you wish to begin your dedicated server on. Download it here.[gamebanana.com]

Select a campaign you want your server to begin on. For instance, I will choose Dives's Indiana Jones and the Temple of Zombies ported from gamemaps.com to the Steam Workshop by ☣ROBLOX, NwiKing☣.

https://steamcommunity.com/sharedfiles/filedetails/?id=1387086938
Once you have installed the campaign (in this case, by clicking the green "Subscribe" button on the campaign's add-on page from the Steam Workshop), navigate to your "C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons" folder. Open the "workshop" folder. Right click on the background within the "workshop" folder, not on a file. Change the viewing mode to "Large Icons" and change the "Sort By" viewing option to "Date modified" and "Descending". Look for the .png thumbnail file of the campaign's add-on. It should be an arbitrary string of numbers. Then, search for the .vpk file associated with said arbitrary string of numbers. Right click on the .vpk file and open it with GCFScape. Do not check the "Always use this app to open .vpk files" option. Within the GCFScape window, find the "missions" folder. Open it and open the .txt file within it. Scroll down until you see a section similar to the following:

"modes" { "coop" { "1" { "Map" "indiana_adventure" "DisplayName" "The Line" "Image" "maps\indiana_adventure" }

The line "Map" "indiana_adventure" denotes the map command parameter. In this example, "indiana_adventure" would be the name of the first map of the custom campaign. Save this map name somewhere on your desktop. Close the GCFScape window. While you are still in the "workshop" folder, right click on the .vpk file of the custom campaign, copy it, and paste it to your desktop. Navigate to "C:\MYODS\left4dead2" and drag and drop the .vpk file of the custom campaign from your desktop into the "addons" folder. Your server cannot run a custom map from a custom campaign if your server directory does not have it installed.

Right click on your dedicated server shortcut icon and open its "Properties" window. In the "Target" field, change "+map c1m1_hotel" to "+map indiana_adventure". The "+map c1m1_hotel" is if you have been following this guide from the beginning. Your new target field should appears as follows:

C:\MYODS\srcds.exe -console -game left4dead2 +map indiana_adventure"

Click "Apply", then click "OK". Whenever you run your server shortcut, your server will now automatically start on the custom map of the custom campaign you installed.

Keep in mind that the map transition loading times for custom maps from custom campaigns depends on the number of add-ons installed by the client, the client's internet connection, and whether or not your server itself has loaded the custom map before. Therefore, if your server is loading a custom map, or is transitioning from the first chapter to the second chapter of a custom campaign for the first time, the loading times will usually take the longest compared to subsequent launches. Even if both you and your server have loaded a particular custom map before, the loading times may still be extensive because the server takes longer to load said particular map than the client. Thus, you can expect loading times anywhere from two minutes to over four and a half minutes for any new given custom map. My advice is to simply remain patient and inform other players who join your server to be patient as well.

If you wish to install add-ons that are not custom campaigns such that everyone who joins will experience the same add-ons that have been installed into your server, use the previously described "copy-and-paste" procedure for .vpk files of your desired add-ons into your server.

For instance, if you wish to enable Rayman1103's Admin System for it to be available for anyone who joins your server, install the add-on first by subscribing to it on the Steam Workshop.

https://steamcommunity.com/sharedfiles/filedetails/?id=214630948
Find its .vpk file in your client-side's "workshop" folder, and copy and paste the .vpk file into your dedicated server directory's "addons" folder. Anyone who joins your server, even if they do not have Rayman1103's Admin System add-on installed, will be be able to access and use its various admin commands if you have provided them admin permissions for the add-on (not to be confused with SourceMod admin permissions).
Updating your Dedicated Server
If you already have a dedicated server, but do not know how to update it in order for it to be compatible with the latest official update of L4D2, this section may be of assistance.

If you ever notice the following line within your server's command prompt window:

Your server is out of date. Please update and restart.

This obviously means that you need to update and re-validate your server files. Otherwise, your server will not function and players will not be able to join it.

First, it is wise to save a copy of your "C:\MYODS" folder somewhere on your computer in the rare event of some sort of file corruption. Shift right click on your "C:\SteamCMD" folder. Select "Open command window here" (or "Open PowerShell window here" if you do not see the first option). Input “steamcmd” (or ".\steamcmd" if you have selected the PowerShell window) without the quotation marks into the prompt line and then press "Enter". Once the "Steam >" prompt line appears again, input the following:

login anonymous

Press "Enter". Repeat this same process for the next two commands, pressing "Enter" after each:

force_install_dir C:\MYODS app_update 222860 validate

Once you see the line "Success! App "222860" fully installed", simply close the command prompt window. Your server has now been updated to suit the latest version of L4D2.

This procedure applies to all and any future official major L4D2 updates.
Conclusion
Assuming you have have followed every step of this guide correctly, your dedicated server should operate without error.

It is indeed possible to establish multiple dedicated servers such that you can have multiple server command prompt windows running on your computer to host multiple active dedicated servers for players to join. Simply repeat all the steps in this guide (e.g. create a new server directory root in your C:\ drive, the same location as your "C:\MYODS" server directory) and launch subsequent dedicated servers through unique shortcuts.

If you have any questions, please do not hesitate to post a comment below or even send me a Steam friend request. I will always try my best to help.
Коментарів: 38
Nopeful 18 трав. о 9:30 
If anyone wants default survivor_friendly_fire_factor damage multiplier values for their server, they can replace the current values with these in their server.cfg

sm_cvar survivor_friendly_fire_factor_easy 0
sm_cvar survivor_friendly_fire_factor_normal 0.1
sm_cvar survivor_friendly_fire_factor_hard 0.3
sm_cvar survivor_friendly_fire_factor_expert 0.5
Hozone5  [автор] 27 жовт. 2024 о 19:14 
Furthermore, it is not possible join a dedicated server through the in-game server browser using an IP.
Hozone5  [автор] 27 жовт. 2024 о 18:43 
@ผีมีจริงนะ

The easiest way to join your server from anywhere would be from the in-game developer console. It is also possible to join it from the Steam group server list in-game, but that is less reliable.
IncludivicS 23 жовт. 2024 о 10:03 
i have a question i want my server can join from anywhere ( matchmaking , steam group [ i done it but it cant join from matchmaking , server browser) how to do it?
Hozone5  [автор] 25 квіт. 2024 о 22:39 
@ToasterTom9737

Though, now that you mention it, I am tempted to try that method out and experiment around with it. I suggest you do it too just for the sake of it.
Hozone5  [автор] 25 квіт. 2024 о 22:37 
@ToasterTom9737

You're most likely correct. It perhaps would be faster and more stable in terms of the connection. However, I am not familiar with that route, so I would simply recommend the usual wireless method.
ToasterTom9737 24 квіт. 2024 о 13:07 
@Hozone5

Thanks for the reply! Out of curiosity do you know how to set it up with Ethernet? I’m thinking it’ll be faster/more stable. Is that route just not recommended?
Hozone5  [автор] 20 квіт. 2024 о 17:53 
@KNIGHT

Not a problem. Though, perhaps it is about time you consider an upgrade in your setup (computer mostly).
Knight 18 квіт. 2024 о 23:26 
@Hozone5

ah i see that's how it works now i know thanks for making it clear to me. I have no choice but to play sourcemod on the local server so they can join when they press play online. but that's why I'm looking for an alternative way because my laptop is burdened by the amount of horde infected and when 8 player survivors join in the game my laptop drops fps and maybe also because of the sourcemod I use to make it more challenging like more CI and SI respawn time 1 second. but thank you anyway:health:
Hozone5  [автор] 18 квіт. 2024 о 20:46 
@ToasterTom9737

Of course. This guide assumes you use only a wireless connection, i.e., no ethernet connections. Thank you for pointing that out.