2hours.gg/

Game servers by the hour. Pay only when you play.

Left 4 Dead 2 server commands and mods

Every 2hours.gg L4D2 server comes with a small mod stack. You deployed it, so you are the admin. Type these in the game chat.

Chat commands

  • !admin: opens the admin menu: kick, ban, votes, server settings. Works for the account that deployed the server.
  • !motd: shows the welcome panel again.
  • !ready / !unready: versus only: the round starts when everyone is ready.
  • !join: co-op with 5+ players: take a survivor slot when you join late or sit in spectator.
  • !ji: co-op: play as a special infected.
  • !zss: infected: respawn yourself if you get stuck.
  • !infhud: versus, infected team: toggle the infected team HUD. Off by default.

Change map, mode or difficulty

Use the web console on your server card. It has buttons for switching campaign and jumping to any chapter, changing game mode (co-op, versus, survival, realism, scavenge), setting difficulty, and adding survivor bots. No RCON setup needed.

What is installed

  • L4DToolZ: unlocks more than 4 player slots.
  • MultiSlots: lets 5-8 humans play as survivors in co-op.
  • Infected Bots: special infected bots, scaled to the player count.
  • Ready-Up: versus lobby: players trickle in, round starts when all are ready.
  • Left 4 DHooks: framework the mods above need. Nothing to configure.

Two ways people join

  • Share the IP: friends paste the connect command. Up to 20 players. You choose who joins.
  • Steam lobby (Community): matchmaking sends players to your server, no IP needed. Random players can join too.

Public or private (Share-the-IP mode)

On a Share-the-IP server, the Join password controls this:

  • Leave it empty = public. Anyone with the IP can join.
  • Set a password = private. Only people with the password get in, everyone else is kicked.

To join a private server, open the console and run: setinfo pw yourpassword ; connect IP:27015

Tip: put +setinfo pw yourpassword in your L4D2 launch options and you only set it once. The normal 'password' command doesn't work in L4D2 (a game bug), so we use setinfo, which does.

Getting random players (Steam-lobby mode)

  1. Deploy with Community as the join mode. The server card shows your search key.
  2. In the game console, run: sv_search_key yourkey
  3. Main menu → Play With Friends → Create New Campaign Lobby → pick mode and campaign → Start.
  4. Keep the lobby Public and random players fill the seats.

Good to know:

  • The lobby picks the campaign and mode. Deploy with the mode you plan to host so the right mods install.
  • A co-op lobby seats 4 humans, versus seats 8. Bots fill the rest.
  • Versus needs one player on each team before Start. Let the lobby fill for a minute.
  • The game keeps running after you leave. Seats can fill without you; if the server is full, you wait for a drop.
  • To get back in: use the connect command on your server card, join a friend (Steam → Join Game), or host a new lobby if the server is empty.
  • The key picks the server, it is not a password. Public lobby = strangers can join. Friends lobby = invite only.

Playing with more than 4

More than 4 humans only works in Share-the-IP mode (the Steam lobby caps co-op at 4). Pick a bigger size on deploy (up to 20), share the IP, and everyone connects. To top the team up with survivor bots, use the web console's Add survivor bot button, or run !muladdbot 2 in chat.

Command reference (by plugin)

Run these from the web RCON console on your server card (or the in-game console). Every command below is verified on a live 2hours.gg L4D2 server.

Map, players & difficulty (Source engine)

status
List connected players, Steam IDs, ping, the map, and whether the server is reserved. Reads can be flaky (a Source quirk); resend if it comes back blank.
changelevel <map>
Load a campaign map (e.g. changelevel c2m1_highway). Reloads the map and briefly drops players. The Campaign dropdown does this for you.
z_difficulty <Easy|Normal|Hard|Impossible>
Set co-op difficulty. Impossible = Expert.
sv_maxplayers
Your total player slots, set by the tier you deploy (4 / 8 / 20). Locked to what you paid for, so it can’t be changed from the console; pick a bigger size for more slots.
sv_region <code>
Matchmaking region (3 = Europe, 0/1 = US, 4 = Asia…). We set this per datacenter so lobbies can find your server; you should not need to touch it.
kick "<name>"
Kick a player by name (use sm_kick for the admin version with a menu).
say <message>
Print a message in everyone’s chat as the server.
sb_add
Add one survivor bot to the base 4 slots.

Steam lobby & matchmaking

sv_search_key <key>
The key that routes a Steam lobby onto this exact server. Set on the server (we do it on deploy) AND by each player in their console before hosting the lobby. Not a password, see the key note above.
sv_allow_lobby_connect_only <0|1>
0 = direct connects allowed, how all our servers boot (on Steam-lobby servers it's your way back into a running game). 1 = lobby joins only, direct IP refused.
sv_force_unreserved <0|1>
1 = allow >4 players by direct IP (Share-the-IP). 0 = keep the lobby reservation so matchmaking can find you (Steam lobby). They are mutually exclusive.
mm_dedicated_force_servers <ip>:27015
Client-side. Pins your lobby to one exact server IP. Optional when the key is unique; useful as a guarantee.

Bigger co-op (MultiSlots)

sm_addbots <n>
Spawn n extra survivor bots past the base 4 (works from the web console; powers its Add survivor bot button).
!muladdbot <n> (sm_muladdbot)
Add n survivor bots as extra team members (opens new slots past 4). Run it in-game as the admin; it cannot be run from RCON.
l4d_multislots_max_survivors <n>
Max survivors allowed (default 20 on our servers, up to 31).
l4d_multislots_min_survivors <n>
Team floor: always kept topped up to this many with bots (default 4). Raise it for a bigger default team.
!join
Take a survivor slot when you join late or are sitting in spectator.

SourceMod admin

sm
The SourceMod command menu (also !admin in chat).
sm plugins list
List the installed plugins and versions.
sm_cvar <cvar> [value]
Read or set a protected cvar. Some cvars return “Unknown command” when typed bare but work through sm_cvar (e.g. mp_gamemode, survivor_limit).
sm_cvar mp_gamemode <mode> ; changelevel <map>
Switch mode (coop, versus, survival, realism, scavenge). The mode only applies on the next map load, so chain a changelevel. The Mode dropdown does both.
sm_cvar z_max_player_zombies <n>
Max special infected alive at once; raise it for a harder swarm. Set via sm_cvar (bare it reads “Unknown”).

Fun / cheats (need sv_cheats 1)

sv_cheats 1
Enable cheat commands. The console’s “Fun” buttons flip this for you.
z_spawn <hunter|tank|witch|…>
Spawn a special infected where you are aiming. sv_cheats only.
director_stop
Stop the AI Director spawning hordes/specials for a calmer run. sv_cheats only.
sb_all_bot_game 1
Let the game run with only bots (for setup/testing). sv_cheats only.

What players type (client-side)

connect <ip>:27015
Join a Share-the-IP server directly.
setinfo pw <password>
Set your join password before connecting to a private (password) server. The normal “password” command is broken in L4D2, setinfo works.
sv_search_key <key>
Set the server’s key before hosting a lobby, so matchmaking lands on that server.

See also

← Back to all guides