Skip to content
/SLASHPLAY

L4D2 console commands

The 107 settings and 27 commands server owners use, with defaults and examples to copy.

134 commands

  1. sv_cheats

    Allows cheat commands and settings on the server, such as god, noclip, give and most Director and z_ settings. Off by default.

    Default 0 (Off)

    Cheats and testing

  2. z_difficulty

    Sets the difficulty: Easy, Normal, Hard (Advanced in the menus) or Impossible (Expert). Normal by default.

    Default Normal

    Maps and game modes

  3. mp_gamemode

    The current game mode, coop by default. Left 4 Dead 2 hides it from the console: change modes with map <map> <mode>.

    Default coop (Campaign)

    Maps and game modes

  4. map

    Loads a map and restarts the game on it. A mode after the map name, such as versus, switches the game mode.

    Command

    Maps and game modes

  5. changelevel

    Changes the server to another map and keeps the current game mode.

    Command

    Maps and game modes

  6. god

    With 1, survivors take no damage. Off by default.

    Default 0 (Off)

    Cheats and testing

  7. give

    Gives an item or weapon to the player who types it, such as give health.

    Command

    Cheats and testing

  8. z_spawn

    Spawns the infected you name where you aim, or somewhere the game picks with auto.

    Command

    Cheats and testing

  9. noclip

    Lets the player who types it fly through walls. Type it again to stop.

    Command

    Cheats and testing

  10. sb_takecontrol

    Takes over a survivor bot. Name the survivor to pick which one.

    Command

    Bots

  11. z_common_limit

    The most common infected alive at once. 30 by default.

    Default 30

    Director and hordes

  12. director_no_specials

    With 1, no special infected spawn: no Hunters, Smokers, Boomers and the rest. Off by default.

    Default 0 (Off)

    Director and hordes

  13. sv_alltalk

    With 1, every player hears every other player's voice, across teams. Off by default.

    Default 0 (Off)

    Server and access

  14. kick

    Removes a player from the server by name.

    Command

    Admin and bans

  15. banid

    Bans a player by userid or Steam ID for a number of minutes, 0 for permanent. Add kick to remove them now.

    Command

    Admin and bans

  16. sv_vote_issue_kick_allowed

    Whether players can call a vote to kick another player. On by default.

    Default 1 (On)

    Voting

  17. sv_gametypes

    The game modes this server allows, as a comma-separated list. The default lists every standard mode.

    Default coop,realism,survival,versus,scavenge,dash,holdout,shootzones

    Maps and game modes

  18. director_afk_timeout

    Seconds a player can stay idle before the game moves them to spectators. 45 by default.

    Default 45

    Server and access

  19. exec

    Runs a config file from the cfg folder, such as server.cfg.

    Command

    Server and access

  20. hostname

    The server's name, shown in the server browser and to players who join.

    Default Not listed

    Server and access

  21. log

    Turns server logging on or off. With it on, the server logs to file, to the console and to UDP log addresses.

    Command

    Server and access

  22. maxplayers

    Shows the player limit. SLASHPLAY servers have 8 slots, set when the server starts.

    Command

    Server and access

  23. say

    Sends a chat message from the console to everyone on the server.

    Command

    Server and access

  24. status

    Lists the current map and every connected player with their userid and Steam ID.

    Command

    Server and access

  25. sv_allow_lobby_connect_only

    With 1, the default, players can only join from a matchmaking lobby. SLASHPLAY starts the server with 0, so direct joins work.

    Default 1 (On)

    Server and access

  26. sv_hibernate_when_empty

    Puts an empty server into a low CPU sleep. SLASHPLAY starts every server with 0 and manages this one.

    Default 1 (On)

    Server and access

  27. sv_lan

    LAN mode: no Steam heartbeat or authentication, and only local network addresses can join. Off by default.

    Default 0 (Off)

    Server and access

  28. sv_logbans

    Writes bans into the server log. Off by default.

    Default 0 (Off)

    Server and access

  29. sv_maxrate

    The most data per second the server sends one player, in bytes. 0, the default, means no cap.

    Default 0

    Server and access

  30. sv_minrate

    The lowest data rate, in bytes per second, the server lets a player use. 5000 by default.

    Default 5000

    Server and access

  31. sv_password

    The join password. Empty by default, so anyone with the address can join.

    Default (empty)

    Server and access

  32. sv_region

    The region the server reports to the server browser. 255 (world) by default on a dedicated server.

    Default 255 (World)

    Server and access

  33. sv_steamgroup

    Links the server to a Steam group by the group's ID.

    Default (empty)

    Server and access

  34. sv_steamgroup_exclusive

    With 1, only members of the server's Steam group can join while it's empty; others can join once someone is playing.

    Default 0 (Off)

    Server and access

  35. sv_tags

    Tags shown to players browsing for servers, separated by commas.

    Default (empty)

    Server and access

  36. sv_visiblemaxplayers

    Overrides the player limit the server reports to players browsing for it. -1, the default, turns the override off.

    Default -1

    Server and access

  37. sv_voiceenable

    Turns voice chat on the server on or off. On by default.

    Default 1 (On)

    Server and access

  38. addip

    Bans an IP address for a number of minutes, 0 for permanent.

    Command

    Admin and bans

  39. kickid

    Kicks a player by userid or Steam ID, with an optional message they see.

    Command

    Admin and bans

  40. listid

    Lists the Steam ID bans in force on the server.

    Command

    Admin and bans

  41. listip

    Lists the IP address bans in force on the server.

    Command

    Admin and bans

  42. rcon_password

    The RCON password. SLASHPLAY's Console tab uses it, so set it on the General tab, not here.

    Default (empty)

    Admin and bans

  43. removeid

    Lifts a Steam ID ban.

    Command

    Admin and bans

  44. removeip

    Lifts an IP address ban.

    Command

    Admin and bans

  45. sv_rcon_banpenalty

    Minutes an address is banned after failing RCON logins too often. 0 by default.

    Default 0

    Admin and bans

  46. sv_rcon_maxfailures

    Failed RCON logins allowed from one address before it gets banned. 10 by default.

    Default 10

    Admin and bans

  47. sv_rcon_minfailures

    Failed RCON logins within sv_rcon_minfailuretime seconds that get an address banned. 5 by default.

    Default 5

    Admin and bans

  48. sv_rcon_minfailuretime

    The window, in seconds, in which failed RCON logins are counted for sv_rcon_minfailures. 30 by default.

    Default 30

    Admin and bans

  49. writeid

    Saves the permanent Steam ID bans to banned_user.cfg.

    Command

    Admin and bans

  50. writeip

    Saves the permanent IP bans to banned_ip.cfg.

    Command

    Admin and bans

  51. sv_allow_votes

    Turns player voting on or off. On by default.

    Default 1 (On)

    Voting

  52. sv_vote_creation_timer

    Seconds a player must wait before calling another vote. 180 by default.

    Default 180

    Voting

  53. sv_vote_issue_change_difficulty_allowed

    Whether players can vote to change the difficulty. On by default.

    Default 1 (On)

    Voting

  54. sv_vote_issue_change_mission_allowed

    Whether players can vote to change the campaign. On by default.

    Default 1 (On)

    Voting

  55. sv_vote_issue_restart_game_allowed

    Whether players can vote to restart the game. On by default.

    Default 1 (On)

    Voting

  56. sv_vote_kick_ban_duration

    Minutes a player kicked by vote is banned from rejoining. 5 by default.

    Default 5

    Voting

  57. sv_vote_plr_map_limit

    Failed votes one player can call per map. 3 by default.

    Default 3

    Voting

  58. sv_vote_show_caller

    Whether a vote shows the name of the player who called it. On by default.

    Default 1 (On)

    Voting

  59. sv_vote_timer_duration

    Seconds a vote stays open for players to answer. 15 by default.

    Default 15

    Voting

  60. director_force_panic_event

    Starts a panic event right away: the Director sends a horde at the survivors.

    Command

    Director and hordes

  61. director_no_bosses

    With 1, no Tanks or Witches spawn. Off by default.

    Default 0 (Off)

    Director and hordes

  62. director_no_death_check

    With 1, the round doesn't end when the whole survivor team is down or dead. Off by default.

    Default 0 (Off)

    Director and hordes

  63. director_no_mobs

    With 1, the Director sends no hordes (mob rushes). Off by default.

    Default 0 (Off)

    Director and hordes

  64. director_panic_forever

    With 1, a panic event never ends: once it starts, the horde keeps coming. Off by default.

    Default 0 (Off)

    Director and hordes

  65. director_start

    Turns infected spawning back on after director_stop.

    Command

    Director and hordes

  66. director_stop

    Stops all infected spawning: wanderers, hordes, special infected and bosses.

    Command

    Director and hordes

  67. director_transition_timeout

    Seconds the server waits for survivors to load into the next chapter. 120 by default.

    Default 120

    Director and hordes

  68. z_health

    Health of each common infected. 50 by default.

    Default 50

    Director and hordes

  69. z_mega_mob_size

    How many infected a panic event spawns in total. 50 by default.

    Default 50

    Director and hordes

  70. z_mob_spawn_max_interval_normal

    The longest time, in seconds, between hordes on Normal. 180 by default.

    Default 180

    Director and hordes

  71. z_mob_spawn_max_size

    The largest horde the Director sends. 30 by default.

    Default 30

    Director and hordes

  72. z_mob_spawn_min_interval_normal

    The shortest time, in seconds, between hordes on Normal. 90 by default.

    Default 90

    Director and hordes

  73. z_mob_spawn_min_size

    The smallest horde the Director sends. 10 by default.

    Default 10

    Director and hordes

  74. z_allow_ai_to_use_abilities

    With 0, AI special infected don't use their abilities: Hunters don't pounce, Tanks don't throw rocks. On by default.

    Default 1 (On)

    Special infected

  75. z_boomer_limit

    The most Boomers the Director keeps in play at once. 1 by default.

    Default 1

    Special infected

  76. z_charger_health

    The Charger's health. 600 by default.

    Default 600

    Special infected

  77. z_charger_limit

    The most Chargers the Director keeps in play at once. 1 by default.

    Default 1

    Special infected

  78. z_exploding_health

    The Boomer's health. 50 by default.

    Default 50

    Special infected

  79. z_frustration

    Turns the Tank's frustration meter on or off. With 0, a player-controlled Tank never loses control for not attacking.

    Default 1 (On)

    Special infected

  80. z_gas_health

    The Smoker's health. 250 by default.

    Default 250

    Special infected

  81. z_hunter_health

    The Hunter's health. 250 by default.

    Default 250

    Special infected

  82. z_hunter_limit

    The most Hunters the Director keeps in play at once. 1 by default.

    Default 1

    Special infected

  83. z_jockey_health

    The Jockey's health. 325 by default.

    Default 325

    Special infected

  84. z_jockey_limit

    The most Jockeys the Director keeps in play at once. 1 by default.

    Default 1

    Special infected

  85. z_smoker_limit

    The most Smokers the Director keeps in play at once. 1 by default.

    Default 1

    Special infected

  86. z_special_spawn_interval

    The game's interval, in seconds, for spawning special infected. 45 by default.

    Default 45

    Special infected

  87. z_spitter_health

    The Spitter's health. 100 by default.

    Default 100

    Special infected

  88. z_spitter_limit

    The most Spitters the Director keeps in play at once. 1 by default.

    Default 1

    Special infected

  89. z_tank_health

    The Tank's base health. 4000 by default.

    Default 4000

    Special infected

  90. z_tank_speed

    The Tank's running speed. 210 by default.

    Default 210

    Special infected

  91. z_tank_throw_interval

    How often a Tank can throw a rock, in seconds. 5 by default.

    Default 5

    Special infected

  92. z_vomit_interval

    How often a Boomer can vomit, in seconds. 30 by default.

    Default 30

    Special infected

  93. z_witch_health

    The Witch's health. 1000 by default.

    Default 1000

    Special infected

  94. adrenaline_duration

    Seconds an adrenaline shot's effect lasts. 15 by default.

    Default 15

    Survivors

  95. first_aid_heal_percent

    Share of a survivor's injuries a first aid kit heals. 0.8, 80 percent, by default.

    Default 0.8

    Survivors

  96. first_aid_kit_use_duration

    Seconds it takes to use a first aid kit. 5 by default.

    Default 5

    Survivors

  97. pain_pills_health_value

    Temporary health pain pills give. 50 by default.

    Default 50

    Survivors

  98. survivor_friendly_fire_factor_easy

    Friendly fire damage multiplier on Easy. 0 by default.

    Default 0

    Survivors

  99. survivor_friendly_fire_factor_expert

    Friendly fire damage multiplier on Expert. 0.5 by default.

    Default 0.5

    Survivors

  100. survivor_friendly_fire_factor_hard

    Friendly fire damage multiplier on Advanced. 0.3 by default.

    Default 0.3

    Survivors

  101. survivor_friendly_fire_factor_normal

    Friendly fire damage multiplier on Normal. 0.1 by default.

    Default 0.1

    Survivors

  102. survivor_limp_health

    Health below which survivors start limping. 40 by default.

    Default 40

    Survivors

  103. survivor_max_incapacitated_count

    How many times a survivor can go down instead of dying, between health kits. 2 by default.

    Default 2

    Survivors

  104. survivor_respawn_with_guns

    What a rescued survivor comes back with: 0 a pistol, 1 a downgrade of their last main weapon (default), 2 their last main weapon.

    Default 1 (Downgrade of last primary weapon)

    Survivors

  105. survivor_revive_duration

    Seconds it takes to revive a downed survivor. 5 by default.

    Default 5

    Survivors

  106. survivor_revive_health

    Temporary health a survivor gets back when revived. 30 by default.

    Default 30

    Survivors

  107. z_survivor_respawn_health

    Health a rescued survivor comes back with. 50 by default.

    Default 50

    Survivors

  108. allow_all_bot_survivor_team

    With 1, the survivor team can be all bots. A human player is still needed for the game to run. Off by default.

    Default 0 (Off)

    Bots

  109. director_allow_infected_bots

    Lets bots fill empty slots on the infected team. On by default.

    Default 1 (On)

    Bots

  110. director_no_survivor_bots

    With 1, the game stops filling empty survivor slots with bots. Off by default.

    Default 0 (Off)

    Bots

  111. sb_all_bot_game

    With 1, the game keeps running on a server with nothing but bots. Off by default.

    Default 0 (Off)

    Bots

  112. sb_allow_leading

    With 1, survivor bots can take the lead instead of always waiting behind the lead human. Off by default.

    Default 0 (Off)

    Bots

  113. sb_dont_shoot

    With 1, survivor bots don't fire their weapons. Off by default.

    Default 0 (Off)

    Bots

  114. sb_friendlyfire

    Whether survivor bots' shots hurt other survivors. Off by default.

    Default 0 (Off)

    Bots

  115. sb_max_team_melee_weapons

    How many melee weapons survivor bots may carry between them. 0, the default, means bots never use melee.

    Default 0

    Bots

  116. sb_stop

    With 1, survivor bots stand still. Off by default.

    Default 0 (Off)

    Bots

  117. director_force_versus_start

    Starts the Versus round now, so infected can spawn even while the survivors are still in the safe room.

    Command

    Versus

  118. director_vs_convert_pills

    Share of pain pills turned into first aid kits in Versus, from 0 to 1. 0.5 by default.

    Default 0.5

    Versus

  119. versus_boss_flow_max

    Latest point in a Versus map, as a fraction of its length, where a Tank or Witch can spawn. 0.9 by default.

    Default 0.9

    Versus

  120. versus_boss_flow_min

    Earliest point in a Versus map, as a fraction of its length, where a Tank or Witch can spawn. 0.25 by default.

    Default 0.25

    Versus

  121. versus_force_start_time

    Seconds before a Versus round starts on its own, even if the survivors are still in the safe room. 90 by default.

    Default 90

    Versus

  122. versus_tank_chance

    Chance of a Tank on a regular Versus map, from 0 to 1. 0.75 by default.

    Default 0.75

    Versus

  123. versus_tank_chance_finale

    Chance of a Tank on a campaign's finale map in Versus, from 0 to 1. 0.1 by default.

    Default 0.1

    Versus

  124. versus_tank_chance_intro

    Chance of a Tank on a campaign's first Versus map, from 0 to 1. 0.3 by default.

    Default 0.3

    Versus

  125. versus_winning_team_goes_last

    With 1, the team that's behind plays survivors first. On by default.

    Default 1 (On)

    Versus

  126. versus_witch_chance

    Chance of a Witch on a regular Versus map, from 0 to 1. 0.75 by default.

    Default 0.75

    Versus

  127. vs_defib_penalty

    Score penalty in Versus for each defibrillator use. 25 by default.

    Default 25

    Versus

  128. vs_survival_bonus

    Bonus score per survivor for finishing a chapter in Versus. 25 by default.

    Default 25

    Versus

  129. vs_tank_damage

    Damage a Versus Tank's punch does. 24 by default.

    Default 24

    Versus

  130. vs_tiebreak_bonus

    Score awarded for winning a Versus tiebreaker. 25 by default.

    Default 25

    Versus

  131. sv_infinite_ammo

    With 1, the weapon a player holds never runs out of ammo. Off by default.

    Default 0 (Off)

    Cheats and testing

  132. sv_infinite_primary_ammo

    With 1, a player's primary weapon never runs out of ammo. Off by default.

    Default 0 (Off)

    Cheats and testing

  133. warp_all_survivors_to_checkpoint

    Moves every survivor to the exit safe room of the current map.

    Command

    Cheats and testing

  134. z_spawn_old

    The game's older version of z_spawn, kept alongside it. Takes the same infected names and auto.

    Command

    Cheats and testing

Questions

How do I run L4D2 commands on my server?

On a SLASHPLAY server, type it in the Console tab of the server page; the reply shows right under it. A value set there lasts until the server restarts. To keep it, add the line to left4dead2/cfg/server.cfg.

How do I keep a setting after a restart?

Settings typed in the console last until the server restarts. Put them in left4dead2/cfg/server.cfg, one per line, and they apply every time the server starts.

Where does this list come from?

SLASHPLAY wrote it from the Valve Developer Community cvar list, checked against the cvarlist of a fresh Left 4 Dead 2 dedicated server: the settings and commands server owners use, with the game's own defaults.

Try them on
your own server.

From $0.03 an hour, only while it runs. New accounts get 6 free tokens.