L4D2 console commands
The 107 settings and 27 commands server owners use, with defaults and examples to copy.
134 commands
- 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
- z_difficulty
Sets the difficulty: Easy, Normal, Hard (Advanced in the menus) or Impossible (Expert). Normal by default.
Default Normal
Maps and game modes
- 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
- 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
- changelevel
Changes the server to another map and keeps the current game mode.
Command
Maps and game modes
- god
With 1, survivors take no damage. Off by default.
Default 0 (Off)
Cheats and testing
- give
Gives an item or weapon to the player who types it, such as
give health.Command
Cheats and testing
- z_spawn
Spawns the infected you name where you aim, or somewhere the game picks with auto.
Command
Cheats and testing
- noclip
Lets the player who types it fly through walls. Type it again to stop.
Command
Cheats and testing
- sb_takecontrol
Takes over a survivor bot. Name the survivor to pick which one.
Command
Bots
- z_common_limit
The most common infected alive at once. 30 by default.
Default 30
Director and hordes
- 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
- sv_alltalk
With 1, every player hears every other player's voice, across teams. Off by default.
Default 0 (Off)
Server and access
- kick
Removes a player from the server by name.
Command
Admin and bans
- banid
Bans a player by userid or Steam ID for a number of minutes, 0 for permanent. Add
kickto remove them now.Command
Admin and bans
- sv_vote_issue_kick_allowed
Whether players can call a vote to kick another player. On by default.
Default 1 (On)
Voting
- 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
- director_afk_timeout
Seconds a player can stay idle before the game moves them to spectators. 45 by default.
Default 45
Server and access
- exec
Runs a config file from the cfg folder, such as server.cfg.
Command
Server and access
- hostname
The server's name, shown in the server browser and to players who join.
Default Not listed
Server and access
- 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
- maxplayers
Shows the player limit. SLASHPLAY servers have 8 slots, set when the server starts.
Command
Server and access
- say
Sends a chat message from the console to everyone on the server.
Command
Server and access
- status
Lists the current map and every connected player with their userid and Steam ID.
Command
Server and access
- 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
- 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
- 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
- sv_logbans
Writes bans into the server log. Off by default.
Default 0 (Off)
Server and access
- 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
- sv_minrate
The lowest data rate, in bytes per second, the server lets a player use. 5000 by default.
Default 5000
Server and access
- sv_password
The join password. Empty by default, so anyone with the address can join.
Default (empty)
Server and access
- 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
- sv_steamgroup
Links the server to a Steam group by the group's ID.
Default (empty)
Server and access
- 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
- sv_tags
Tags shown to players browsing for servers, separated by commas.
Default (empty)
Server and access
- 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
- sv_voiceenable
Turns voice chat on the server on or off. On by default.
Default 1 (On)
Server and access
- addip
Bans an IP address for a number of minutes, 0 for permanent.
Command
Admin and bans
- kickid
Kicks a player by userid or Steam ID, with an optional message they see.
Command
Admin and bans
- listid
Lists the Steam ID bans in force on the server.
Command
Admin and bans
- listip
Lists the IP address bans in force on the server.
Command
Admin and bans
- 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
- removeid
Lifts a Steam ID ban.
Command
Admin and bans
- removeip
Lifts an IP address ban.
Command
Admin and bans
- sv_rcon_banpenalty
Minutes an address is banned after failing RCON logins too often. 0 by default.
Default 0
Admin and bans
- sv_rcon_maxfailures
Failed RCON logins allowed from one address before it gets banned. 10 by default.
Default 10
Admin and bans
- sv_rcon_minfailures
Failed RCON logins within
sv_rcon_minfailuretimeseconds that get an address banned. 5 by default.Default 5
Admin and bans
- 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
- writeid
Saves the permanent Steam ID bans to banned_user.cfg.
Command
Admin and bans
- writeip
Saves the permanent IP bans to banned_ip.cfg.
Command
Admin and bans
- sv_allow_votes
Turns player voting on or off. On by default.
Default 1 (On)
Voting
- sv_vote_creation_timer
Seconds a player must wait before calling another vote. 180 by default.
Default 180
Voting
- sv_vote_issue_change_difficulty_allowed
Whether players can vote to change the difficulty. On by default.
Default 1 (On)
Voting
- sv_vote_issue_change_mission_allowed
Whether players can vote to change the campaign. On by default.
Default 1 (On)
Voting
- sv_vote_issue_restart_game_allowed
Whether players can vote to restart the game. On by default.
Default 1 (On)
Voting
- sv_vote_kick_ban_duration
Minutes a player kicked by vote is banned from rejoining. 5 by default.
Default 5
Voting
- sv_vote_plr_map_limit
Failed votes one player can call per map. 3 by default.
Default 3
Voting
- sv_vote_show_caller
Whether a vote shows the name of the player who called it. On by default.
Default 1 (On)
Voting
- sv_vote_timer_duration
Seconds a vote stays open for players to answer. 15 by default.
Default 15
Voting
- director_force_panic_event
Starts a panic event right away: the Director sends a horde at the survivors.
Command
Director and hordes
- director_no_bosses
With 1, no Tanks or Witches spawn. Off by default.
Default 0 (Off)
Director and hordes
- 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
- director_no_mobs
With 1, the Director sends no hordes (mob rushes). Off by default.
Default 0 (Off)
Director and hordes
- 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
- director_start
Turns infected spawning back on after
director_stop.Command
Director and hordes
- director_stop
Stops all infected spawning: wanderers, hordes, special infected and bosses.
Command
Director and hordes
- director_transition_timeout
Seconds the server waits for survivors to load into the next chapter. 120 by default.
Default 120
Director and hordes
- z_health
Health of each common infected. 50 by default.
Default 50
Director and hordes
- z_mega_mob_size
How many infected a panic event spawns in total. 50 by default.
Default 50
Director and hordes
- z_mob_spawn_max_interval_normal
The longest time, in seconds, between hordes on Normal. 180 by default.
Default 180
Director and hordes
- z_mob_spawn_max_size
The largest horde the Director sends. 30 by default.
Default 30
Director and hordes
- z_mob_spawn_min_interval_normal
The shortest time, in seconds, between hordes on Normal. 90 by default.
Default 90
Director and hordes
- z_mob_spawn_min_size
The smallest horde the Director sends. 10 by default.
Default 10
Director and hordes
- 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
- z_boomer_limit
The most Boomers the Director keeps in play at once. 1 by default.
Default 1
Special infected
- z_charger_health
The Charger's health. 600 by default.
Default 600
Special infected
- z_charger_limit
The most Chargers the Director keeps in play at once. 1 by default.
Default 1
Special infected
- z_exploding_health
The Boomer's health. 50 by default.
Default 50
Special infected
- 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
- z_gas_health
The Smoker's health. 250 by default.
Default 250
Special infected
- z_hunter_health
The Hunter's health. 250 by default.
Default 250
Special infected
- z_hunter_limit
The most Hunters the Director keeps in play at once. 1 by default.
Default 1
Special infected
- z_jockey_health
The Jockey's health. 325 by default.
Default 325
Special infected
- z_jockey_limit
The most Jockeys the Director keeps in play at once. 1 by default.
Default 1
Special infected
- z_smoker_limit
The most Smokers the Director keeps in play at once. 1 by default.
Default 1
Special infected
- z_special_spawn_interval
The game's interval, in seconds, for spawning special infected. 45 by default.
Default 45
Special infected
- z_spitter_health
The Spitter's health. 100 by default.
Default 100
Special infected
- z_spitter_limit
The most Spitters the Director keeps in play at once. 1 by default.
Default 1
Special infected
- z_tank_health
The Tank's base health. 4000 by default.
Default 4000
Special infected
- z_tank_speed
The Tank's running speed. 210 by default.
Default 210
Special infected
- z_tank_throw_interval
How often a Tank can throw a rock, in seconds. 5 by default.
Default 5
Special infected
- z_vomit_interval
How often a Boomer can vomit, in seconds. 30 by default.
Default 30
Special infected
- z_witch_health
The Witch's health. 1000 by default.
Default 1000
Special infected
- adrenaline_duration
Seconds an adrenaline shot's effect lasts. 15 by default.
Default 15
Survivors
- 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
- first_aid_kit_use_duration
Seconds it takes to use a first aid kit. 5 by default.
Default 5
Survivors
- pain_pills_health_value
Temporary health pain pills give. 50 by default.
Default 50
Survivors
- survivor_friendly_fire_factor_easy
Friendly fire damage multiplier on Easy. 0 by default.
Default 0
Survivors
- survivor_friendly_fire_factor_expert
Friendly fire damage multiplier on Expert. 0.5 by default.
Default 0.5
Survivors
- survivor_friendly_fire_factor_hard
Friendly fire damage multiplier on Advanced. 0.3 by default.
Default 0.3
Survivors
- survivor_friendly_fire_factor_normal
Friendly fire damage multiplier on Normal. 0.1 by default.
Default 0.1
Survivors
- survivor_limp_health
Health below which survivors start limping. 40 by default.
Default 40
Survivors
- survivor_max_incapacitated_count
How many times a survivor can go down instead of dying, between health kits. 2 by default.
Default 2
Survivors
- 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
- survivor_revive_duration
Seconds it takes to revive a downed survivor. 5 by default.
Default 5
Survivors
- survivor_revive_health
Temporary health a survivor gets back when revived. 30 by default.
Default 30
Survivors
- z_survivor_respawn_health
Health a rescued survivor comes back with. 50 by default.
Default 50
Survivors
- 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
- director_allow_infected_bots
Lets bots fill empty slots on the infected team. On by default.
Default 1 (On)
Bots
- director_no_survivor_bots
With 1, the game stops filling empty survivor slots with bots. Off by default.
Default 0 (Off)
Bots
- sb_all_bot_game
With 1, the game keeps running on a server with nothing but bots. Off by default.
Default 0 (Off)
Bots
- 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
- sb_dont_shoot
With 1, survivor bots don't fire their weapons. Off by default.
Default 0 (Off)
Bots
- sb_friendlyfire
Whether survivor bots' shots hurt other survivors. Off by default.
Default 0 (Off)
Bots
- 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
- sb_stop
With 1, survivor bots stand still. Off by default.
Default 0 (Off)
Bots
- 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
- 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
- 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
- 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
- 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
- versus_tank_chance
Chance of a Tank on a regular Versus map, from 0 to 1. 0.75 by default.
Default 0.75
Versus
- 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
- 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
- versus_winning_team_goes_last
With 1, the team that's behind plays survivors first. On by default.
Default 1 (On)
Versus
- versus_witch_chance
Chance of a Witch on a regular Versus map, from 0 to 1. 0.75 by default.
Default 0.75
Versus
- vs_defib_penalty
Score penalty in Versus for each defibrillator use. 25 by default.
Default 25
Versus
- vs_survival_bonus
Bonus score per survivor for finishing a chapter in Versus. 25 by default.
Default 25
Versus
- vs_tank_damage
Damage a Versus Tank's punch does. 24 by default.
Default 24
Versus
- vs_tiebreak_bonus
Score awarded for winning a Versus tiebreaker. 25 by default.
Default 25
Versus
- sv_infinite_ammo
With 1, the weapon a player holds never runs out of ammo. Off by default.
Default 0 (Off)
Cheats and testing
- 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
- warp_all_survivors_to_checkpoint
Moves every survivor to the exit safe room of the current map.
Command
Cheats and testing
- 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
Nothing matches.
Try part of the name, like freeze or money, or a word from what it does.
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.