Console commands

The console is a feature of many games that can be used to change certain elements of a game. In Left 4 Dead and Left 4 Dead 2, it can be activated in the Options menu (go to "Keyboard/Mouse", then Enable the "Allow Developer Console" option) and then displayed by pressing the tilde (~) key. Valve features a quick-type feature in their consoles that allows rapid entry of commands.

Note that the key used to access the developer console may be different on non-U.S. keyboard layouts; for example, a standard UK keyboard layout uses the tilde key (left of the "1" key and below Escape).

You may edit the config file within your game directory directly. The file is located under

Just open the file with a text-editor of your choice and adjust it to your needs.

Another workaround for non-U.S. keyboard layouts ― Finnish in particular ― is to switch to a U.S. keyboard layout, start the game, opening the console and typing, where x is whichever key you wish to bind the command to, then switching back to your own language. If you can't open the console by changing the keyboard layout, right click on Left 4 Dead 2 in the Steam Library, click properties, click 'Set Launch Options...' then type  in the field. Binding  to a key bypasses the Steam Cloud overwriting custom settings made, and allows you to pick a key on a familiar keyboard layout. The console key chosen might not work in the lobby or start menu, but it should work in-game.

Cheats
The  console variable is a prerequisite command to many of the game-altering commands found in the Left 4 Dead series (including other Valve games, such as Half-Life). In the Left 4 Dead series, by setting sv_cheats to 1, most commands are then recognized by the game. It is with  that most of the exploits were found by users in the demo during its pre-order era.

Enabling cheats disallows unlocking achievements. This includes Grind Achievements, which are achievements based on your lifetime performance (i.e. killing 5,359 Zombies in Crash Course) and any other Achievement that uses a Counter-based system to acquire (i.e. Collect 10 Boomer Bile Bombs off Dead CEDA Agents) as well, so any Infected killed with cheats enabled will not count towards Zombie Genocides or any similar achievement. Even when turned off, achievements are still disabled. Only restarting the particular game will allow achievements. Achievements can still be earned through an online game as long as cheats were never enabled on that server.

Unfortunately, enabling cheats in Left 4 Dead 2 is more complicated than in the previous game. Cheats must be enabled in the main menu, before starting a game, and even then you must use the  command to load a game with cheats enabled - starting a local server via any of the lobbies will disable cheats.

Annotated list of commands
Knowing all the commands isn't quite as good as knowing what they do. The following will describe what each command does and its default value.

Important things to know about your cheat console:
 * Some commands require you to be the game host (such as ).
 * It is assumed that you have cheats enabled for the commands described in this section.
 * If you turn on cheats then turn them off, many settings are discarded!
 * The console can auto-complete commands, making it inefficient to type more than you need to; just type a few letters and then hit the up/down arrows.
 * Commands can be chained. Example:  enable cheats, spawn a boomer, hunter, smoker, horde, then turn off cheats, all in that order.
 * You can store your commands in the " " file you create in a text editor like "Notepad" (Notepad++ is recommended for this) and put it in . While it isn't necessary to store it in the autoexec file, doing so will allow automatic execution of the commands saved when your server runs. You can also execute a particular config file, for instance, " ", by inputting " " in the console.
 * If you are not sure of the correct spelling of a command, just type the first set of letters that you know and press "Tab." A list will appear below the input field listing each command beginning with what you have just typed. Press the "Tab" key to cycle through the commands listed.

Noclip out of the map
Want to go to the sky or go out of the map? Than use these commands. This disables collision and physics, which allows you to fly through walls and in the air around the map. Now you can get a good picture.

This command allows you to change the speed at which you noclip. Be cautious as to not set the speed too high, as you can get yourself lost outside of the map.

God mode
God mode. Useful for being like a god as you'll take no damage at all. May hell fear you.

god 1

Survivors do not take any damage, and will not be slowed by Special Infected attacks. The only real way to lose is to somehow leave everyone hanging on a ledge. The only realistic scenario for that is that you are hanging off the ledge, while the ai tries to help you, but just falls to their doom instead.

Tip: If a Survivor has fallen from a ledge, or pinned somewhere out of reach, use the  command to save them.

Budget god mode
God mode is obviously OP, but what if we nerfed it a little bit? It is somewhat similar to godmode in that you cannot die, but you still receive damage. However, if you aren't the last survivor alive, you'll still be incapacitated as per normal gameplay. If you are, then whenever you take a hit that'd deplete your health, it will be reset to 10 instantly, thus protecting you from dying or incapacitatation. However, sometimes it can still kill after receiving damage rather than just incapacitation or restored HP, so just be careful.

Stopping the apocalypse
This command will stop the Director from spawning any Infected, so you can explore the map without fights, or you're filming like a video or something. director_stop To start the Director again, type in:

director_start

Note: This code will not de-spawn any living Special Infected. Note: Infected in map design will still spawn, including the bride Witch in The Riverbank, Witches in The Sugar Mill, the Tank in train car in The Docks, as well as every Tank during the finales.

The witch is calmer...
z_witch_anger_rate 0.2 This command makes it so the witch will start to get angrier slower than usual, allowing anyone to get close to her with more time. You can also increase this so that the witch is really pissed, You might have to kill your AI to even pass this witch without anyone dying.

Spawning in Props
Do you feel like the map doesn't have enough props? Now you can spawn in a blockade so you can't progress through the map! cl_precacheinfo modelprecache This command gives you an advanced list of items. After you choose what you want, you need to place it after the following:

prop_dynamic_create // creates prop with animation potential

prop_physics_create // creates prop with gravity, mass, and collision properties

Want to play as someone else?
Looks like you're playing as Nick or Bill. You don't want to play as them, but rather, as someone else. Now you will be the ultimate identify thief.

Type in this command to switch between Survivors. Entering this command while looking at another Survivor will switch to that one. If there are no Survivors directly on the crosshair, it will pick the one closest to it.

Put the name of a Survivor bot following the command to switch to that Survivor; for example,  will let you control Zoey.

Also, in online gameplay it is possible to change your designated Survivor at joining the game by opening the console and putting in:

jointeam 2 It is possible also to do this when in mid-play, you just need to change your view to spectator:

spectate jointeam 2

Spawn in some infected
These commands can be used to spawn in additional enemies, in case you want to test something out, or your just really bored.

z_spawn tank z_spawn witch z_spawn boomer z_spawn smoker z_spawn hunter z_spawn common, z_spawn, z_spawn horde (the first two commands spawn a single common infected; the latter spawns a horde.) z_spawn mob (Mobs last a LOT longer than the usual horde) Just be sure you don't spawn in too many infected, as it will crash your game.

Removing infected
To remove Specials, use the  command, followed by the name of the special in question. For example, if a Jockey was riding you and you're a lone player, type  and it'll magically disappear. This command does not work on Witches or Common Infected. To bind multiple kicks to a key, it is safer to use the  command in between the kick commands.

bind K "kick Tank; wait; kick Boomer; wait; kick Smoker; wait; kick Hunter" This stops each command executing simultaneously, instead it waits at least one frame before parsing the next command.

Spawning more than one of the same Special Infected causes their names to go into a numbered list starting with no number. For example:


 * Hunter
 * (1)Hunter
 * (2)Hunter
 * (3)Hunter

When you try to kick a Hunter and it doesn't work, then there may be more than one Hunter on the map.

If you want to remove those sum-of-bitches Common Infected and Witches too, give them a threatening stare and type down. Any Common Infected and Witch that are under your crosshair will be killed instantly.

Note: For some reason, if you throw a Bile Bomb at a bunch of force-spawned Uncommons, they will start pushing rather than hitting each other, like when you bash one with your weapon. Also, if you throw a Bile Bomb on Jimmy Gibbs Jr., the Purple Aura remains on him even after the effects have faded, thus lighting him up through walls.

True single player
If you hate your teammates so much you want to do actual solo, then this is going to be your favorite command! Now that biker dude disappeared, only his weapons and whatever other items he was carrying as the only evidence as to his existence. Now you can finally enjoy some actual single player whilst kicking the special infected out of the server.

This also kicks them out forever, so you'll never see them again.

Counter Strike: Source weapons
Having a CS:GO weapon in left 4 dead might sound weird, but it exists.

type in  in the console, and then the item names will appear.

give smg_mp5 give sniper_awp give sniper_scout give rifle_sg552 These originally did no damage until entering a safe room with the weapons, however this was fixed when CS:S' weapons were added as official content globally in The Last Stand Update. However, CS:S weapons were available and functional before the update in Germany and Australia.

Want more melee weapons?
These are the melee weapons that are either made by individual authors or can be found in some custom campaigns & survial mapssuch as Suicide Blitz 2, Blood Tracks, Left 4 Evil Dead, Necropolis, Kink, Death Mountain, Deathcraft II, Redemption II, Dark Wood, Mellow Manor, Farewell Chenming, Session 9, The Bloody Moors, Fall in Death, TRAPPED, Helm's Deep Reborn, Energy Crisis, Helms Deep: Reborn, and The Scrap Yard. Some of them are either part of the maps, hidden in the map files, or can be downloaded as standalone VPKs.

Now, I must warn you, there is like a hundred melee weapons in the list below. So don't freak out over which weapon your going to pick, because you are.

give 2_handed_concrete give aetherpickaxe give aethersword give arm give b_brokenbottle give b_foamfinger give b_legbone give bajo_roku give bamboo give barnacle give bigoronsword give bnc give bottle give boxing give bow give bt_nail give bt_sledge give btorch give chains give chair give chair2 give cleaver give cleaverfast give combat_knife give computer_keyboard give concrete1 give concrete2 give custom_ammo_pack give custom_shotgun give dagger_water give daxe give dekustick give dhoe give didgeridoo give doc1 give dshovel give dsword give dustpan give electric_guitar2 give electric_guitar3 give electric_guitar4 give enchsword give extbaton give fishingrod give flamethrower give foot give fubar give gaxe give ghoe give gladius give gloves give gman give gpickaxe give great_sword give gshovel give guandao give guitar give hammer give hammer_roku give handax give helms_anduril give helms_hatchet give helms_orcrist give helms_sting give helms_sword_and_shield give hylianshield give iaxe give ihoe give ipickaxe give isword give kanasaibo give katana2 give kitchen_knife give kukri give lamp give legosword give leon_knife give lightsaber give lobo give longsword give long_sword give m72law give mace give mace2 give mastersword give mirrorshield give mop give mop2 give morning_star give muffler give nailbat give old_cleaver give oz_roku give panic_chair give paper_bat give pickaxe give ping_pong give pipehammer give pot give queue give riotshield give rockaxe give roku_bass give roku_cymbal give roku_guitar give sabel give scup give scythe_roku give sentry give sh2wood give shoe give shotel give slasher give sledgehammer give sokka_sword give spickaxe give spikedbat give sshovel give ssword give stun_rod give syringe_gun give thrower give tireiron give tonfa_riot give trashbin give vampiresword give wand give water_dagger give waterpipe give waxe give weapon_chalice give weapon_morgenstern give weapon_shadowhand give weapon_sof give woodbat give wpickaxe give wrench give wshovel give wsword give wulinmiji give zuko give zuko_knife

Demo Weapons
Surprise Surprise! There are still demo weapons in the game itself!

These also work in the full game, with the exception of the grenade launcher:

give autoshotgun give hunting_rifle give health give rifle give pistol give smg give shotgun give pain_pills give first_aid_kit give pipe_bomb give molotov give vomitjar give propanetank give gascan GIVE LIFE

ent_create weapon_grenade_launcher

In the full game, the Grenade Launcher can be spawned via the  command as with the other weapons, but because the grenade launcher was never meant to be obtainable in the demo, it must be created using   as shown above.

Dropping Armageddon
Using this will immediately spawn a throwable under your feet whenever you use it. Just make sure to get out as soon as you type in this command.

fire // drop a Molotov in the center of the character lighting you on fire, so move fast boom // drop a Pipe Bomb in the center of the character ready to explode

How many more zombies would you like?
By default, the game limits how many zombies are drawn at any given time. You can bypass this limit to get any an absurd amount of zombies to spawn and for your computer to beg for their lives.

z_common_limit 30 By doing this, well, more zombies can be spawned in at one time. So if you give the director like a limit of 500, they could spawn in 500 zombies, because if there isn't a limit, why waste it?

But how can we get more zombies in a horde? Simple! z_mob_spawn_min_interval_expert 90 z_mob_spawn_max_interval_expert 180 z_mob_spawn_min_size 10 z_mob_spawn_max_size 30

Now, when the director spawns in a horde, they can spawn even more zombies to challenge you. This is where the game might start to crash, so don't go that crazy.

But that's still not enough? Hmm... Perhaps you need a MEGA MOB!

z_mega_mob_spawn_min_interval 420 z_mega_mob_spawn_max_interval 900 z_mega_mob_size 50

Now, you can truly fill the map with so many zombies you could forge evidence to saying that you killed 3,000 zombies!

But what about the zombies themselves? They are too sluggish in reaction time and wander too little... We can fix that.

z_must_wander 0 z_acquire_far_range 2500 z_acquire_far_time 5 z_acquire_near_range 200 z_acquire_near_time 0.5 Now the zombies can see you much further, patrol the map, and react near instantly! This is tougher than you might think.

Okay, if you've gotten this far without dying, we're gonna need more special's around. And luckily, we can make it so there is no shortage of special's. z_special_spawn_interval 45 z_exploding_limit 1 z_gas_limit 1 z_hunter_limit 1 z_minion_limit 3 // This limits the total number of special infected alive at a given time to 3, regardless of what combination that might be.

If you were to set the minion limit from 3 up to 6, there could be, at most, 6 special infected alive at one time. However, since the limits for each specific type are set to 1, you could not get more than 1 boomer, 1 hunter, and 1 smoker. Similarly, if you turned the hunter/smoker/boomer limits all up from 1 to 2, but left the minion limit at 3, you could still only have 3 specials alive at one time, but you could end up with 2 hunters and a smoker, or 2 boomers and a hunter, etc... turning minion limit up to 6, and then each individual limit up to 2 would theoretically allow you to have 2 boomers on the field at the same time as having 2 hunters and 2 smokers all running around, although it's possible that a slot is reserved for a tank.

Now, let's say you want a massive horde right now. Sure, why not?

director_force_panic_event

This will spawn a mega mob to try and stop you, and if you set it so the director can spawn in more zombies, it will also follow that rule.

But if you want an endless horde to beat the crap out of, well. Here's the command.

director_panic_forever 1 Whenever a mega mob spawns, it will never, and i repeat, NEVER stop the horde. You can't even move past them at this point.

But you can't decide how you wanna play? Well here's a challenge! z_special_spawn_interval 45 z_exploding_limit 1 z_gas_limit 1 z_hunter_limit 1 z_minion_limit 9 z_spawn mob z_spawn tank // you WILL be overrun with lots of Infected if you try this

Combine the last two commands together and try to beat a single level without any cheats or game-breaking mods.

Be sure not to spawn too many zombies, as it will lag your game out or worse; crash it.

No more rescues...
Do you want to be trapped in the level forever? Now, perishing is a guarantee.

The variable " " controls how far your teammates must get beyond your corpse before you can be rescued. Set to minus one to preclude that ever happening. The second variable, " ", controls how many seconds must elapse after death before you come up for reincarnation. Set to "-1" to preclude that possibility.

rescue_distance 4500 rescue_min_dead_time 60

Deadlier zombies
Do the zombies deal too little damage? Now no longer! You can change it so they can kill you in a single hit!

hunter_pz_claw_dmg 10 z_pounce_damage 5 // There's a delay of 1 second where a teammate can knock it off and you don't take this damage tongue_choke_damage_amount 10 z_hit_from_behind_factor 0.5 // If a zombie hits you in the back, multiplies the damage done z_witch_damage 100

But what about the environment and those unknown damage multipliers? We can change that too.

inferno_damage 40 // Damage per second when getting flamed survivor_extra_damage_ammo_factor 1.25 // Appears to multiply the overall amount of                                           friendly fire damage. At zero, it does no                                          damage, even on expert though a decimal with many places will still do a good chunk with the Auto Shotgun. Does not appear to change damage on Infected at all. TODO: test this more z_gun_damage 10 // Melee damage done to doors, boxes, and the like, but not Infected

Sprinting towards hell
You might think the survivors are too slow. Now you can change it so they are a bit faster.

survivor_walk_speed 85 // For reference base, movement speed is 210 and base Infected speed is 250 Just be sure you don't set it to be too crazy, or you'll fling yourself out of the map.

Teleporting to your demise
Is everyone too far away from you? Now you can force them to be with you by making them teleport to you or anywhere else!

Just don't send them to a tank. warp_all_survivors_here  // Warp all survivors to the player's cursor warp_all_survivors_to_battlefield // Warp all Survivors to the battlefield warp_all_survivors_to_checkpoint // Warp all Survivors to the exit checkpoint warp_all_survivors_to_finale // Warp all Survivors to the finale radio warp_far_survivor_here // Teleport the farthest away Survivor to your cursor position warp_to_start_area // Warp yourself to a Survivor spawn area However, for this command to work, you need to be the game host.

Versus for the man with no friends
NOTE: This has been patched, but if you go to the other "NOTE", you'll find away to fight the bots again.

Okay, the title might have been too harsh, However, if you truly have no friends, you can fight the bots themselves. With this command, you can play versus mode with bots.

Do note that the Survivor Bots will walk through the stage well enough, but may get hung up when it comes to pushing certain buttons or leaving certain areas. Simply switch teams again, accomplish the goal, and switch back. Do take note that the map that you are playing is still a co-op map and may end prematurely once both teams have played through. To avoid this, vote for a change in campaigns to load the Versus version of the maps.

NOTE: This cheat has been patched. In order to do this, you must enter. You must then finish the level and you will switch teams afterwards. If you want the AI to play with you, enter. The AI will then spawn other Infected to play with you. They won't make the best decisions, and you will likely be the only one killing anyone. You can also play survival mode by entering. You cannot use this method for Left 4 Dead 2, as mp_gamemode is not recognized by the Developer Console. You must enter. For example, to play Versus Mode on The Hotel, you must enter "map c1m1_hotel Versus". This will allow you to play Versus for the entire campaign. The  command is also not recognized, so you must enter "vs_maxteamswitches" and then set it to something big like 999. Often, you will spawn in on the second or third map as the wrong team, so you can still switch. Sometimes, you will even spawn in as a Spectator. You will have all AI teammates, unlike the first Left 4 Dead where playing Versus by yourself meant by yourself.

'''The Survivor Bots won't leave the safe room unless you enter "sb_all_bot_team 1". They will move through the level very fast, but they won't sit in the safe room for hours.'''

NOTE: With the release of The Sacrifice, the  command is no longer recognized in Left 4 Dead 2, and has been renamed to , which will only work with the command line option. This is not a console command. This can be added by right-clicking on the game in Steam, selecting "properties," clicking "Set launch options," and adding it there.

If all of those don't work, try this:

sv_cheats 1

sb_all_bot_team 1 sb_all_bot_game 1

If that doesn't work:

director_no_human_zombies 0

director_force_versus_start

Then hit the team change key (M by default). You can choose if you like to be an Infected or Survivor.

LAN game
To play offline on a local LAN (works with Steam in offline mode and you only need one Steam account)
 * 1) Set launch option -console
 * 2) Launch the game on server and clients
 * 3) On the server, bring up the console (~) and type:

sv_lan 1 sv_allow_lobby_connect_only 0 map Then without hitting enter after "map", you will see a list of available maps. typing the first letter of the map name will give you more choices.
 * 1) Wait for the game to start
 * 2) Vote for the difficulty level you want.
 * 3) Input   to check the IP
 * 4) On the clients, bring up the console and type the following, replacing IP_ADDRESS with the servers LAN IP address:

connect IP_ADDRESS

Bile/Rock Target Practice
With this command, you can practice Vile and Rock throwing as a Special Infected. Now your prepared to take on the survivors.

sv_cheats 1 // You'll need this for all the commands map l4d_airport03_garage Versus // This level provides an extremly good practice environment, but you should try other maps, too. sb_all_bot team 1 // Without this, the game will shut down because there aren't players on the other team. sb_stop 1 // Without this, the Survivors will get in the way of your game; best to put this cheat in before sb_all_bot_game 1 Now you've got those stupid bots out of the way, you can begin your practice. Lets start with throwing some rocks.

z_spawn tank z_tank_rock_debug 1 // Creates a small cube where your rock hits, helps get an idea of where your throws land z_tank_throw_interval 1 // Makes the delay between throws nonexistent; just dont get used to throwing rocks like a submachine gun z_spawn boomer // These provide excellent target practice Now you've mastered rock throwing, you can do the same with bile.

z_spawn boomer z_vomit_debug 1 // Similar to z_tank_rock_debug 1, only it creates lines to show where the puke hitboxes travel. In other words, shows where you barf) z_vomit_interval 1 // What progress do you expect to make only                     puking every half-minute? Now you can do                      it every second. Again, don't get used to                      puking like a submachine gun

Lighting to kill your eyes or to save them
Is the map too dark, or too bright? Now, you can change that.

Pitch Black Mode
To fully embrace the nightmare and to fight the dark, this command is all up for that.

sv_cheats 1

fog_override 1

fog_enable 0 It disables the white background fog to play the game without the unrealistic lighting effect. This was the original way the game was designed per the development team: Left 4 Dead takes place in a variety of dimly lit night-time environments. Because of this, play testers weren't able to see zombie silhouettes in the mid-ground and background. Because of this, they were repeatedly getting mobbed. While sudden zombie attacks were unarguably scary, they were also frustrating—players weren't being given the information they needed to react. They wanted that "Here they come!" moment, and we weren't giving it to them. The solution was light-colored fog. While not as realistic-looking as actual fog in some settings, it meant play testers could see attackers in the distance. Once they were able to anticipate attacks, play testers started to have a much better time."

in L4D2, disabling fog also disables rendering of water, leaving empty spaces everywhere where there used to be water.

Full Bright
If you wish to explore the map in full daylight mode use this.

No Textures
This will cause the models in-game to not be textured. Why would you do this?

Flashlight
Alternatively, if you wish to use your flashlight to see the difference between daylight and normal map lighting, use the following commands: r_flashlightconstant 1 // select constant attenuation instead of linear or quadratic light fall off. r_flashlightfov 179 // default is 53 degree cone. r_flashlightfar 9999

Better screenshots
To hide crosshair and other overlay elements:

sv_cheats 1 hidehud 4 0 returns to normal. 2 and 3 toggle certain elements on/off. Even though it does not look like you can change weapons, cl_drawhud 0 might help you more.

Change Player Name
This allows a player to use a name different from their Steam name.

setinfo name example

This allows the name change to be bound to a key as well. Additionally, this is temporary and only lasts on the game you are on until it's finished or you leave. To use names that have spaces in them, surround the whole thing in quotes, so if you wanted Example Name as your temporary name, you would type:

setinfo name "Example Name"

Kill
using " " will kill the target player immediately. To kill a player, type " ". But the name must be the player's NPC name. So, to kill Bill, type " ". You do not need to type the whole name; to kill Louis, for instance, you can simply type " ". This won't work if someone else has L at the beginning of their name. Note that this is not efficient when hordes of tank spawn, so try " " instead.


 * Note: The following only applies in Left 4 Dead 1: Using this code on Boomers will neither cover Survivors around him/her in Bile nor stumble anyone standing too close.
 * A bug in L4D2 caused the players to commit suicide if they use "kill N" (For example, when killing Nick, the player dies instead, even if they are not Nick himself, and this trick also seems to work if a versus match allows cheats and you play as any of the infected.)

Replacing Kill with " " works too.

Respawn
Enter " " to respawn your character.

Additionally, you can type "respawn_all" to resurrect bots and other dead players.

Third-person
" " or " " to get a view from your shoulder.

firstperson thirdperson thirdpersonshoulder Note: By default, the crosshair in third person shoulder mode isn't aligned properly, so all of your shots will go either left or right of the crosshair, depending on the distance.

Ignite
The command  gives you the fire overlay below your screen and the ability to light movables by  jumping on them. This command does no self-damage.

Speaking Character
Type " " to have your character speak. Most people have been observed as (over)using " ". Nearly all of the commands for this command start with " " An update on February 19th, 2010 has disabled this command for Left 4 Dead 2, but this is still available in the original. This does not require the use of "sv_cheats 1". Some players have made their own radial voice menus (x and z key commands) as an add-on in order to still have that feature in Left 4 Dead 2.

No Special Infected
Enter:. In finales, there might still be certain Specials that will still spawn, however, you can get rid of them by kicking them out. For example, " " or " ," you can bind the kick command to a key so when they show up, press the key you bound it to and they will disappear.

Infinite Ammo
To have infinite grenades, ammo, or chainsaw fuel, just type in console. Or if you just want it for your primary weapon, type

Items Spawn Chance
To visually see all items that spawned (yellow), and that could possibly spawn in the map (white), use

director_debug_scavenge_items 1

General AI status
To see the general status of the AI Manager (Director), use:

director_debug 1

Left 4 Dead 2 Commands
To activate cheats within Left 4 Dead 2 start a map using the  command. Achievements will be turned off, however. Most commands from Left 4 Dead work in Left 4 Dead 2, but some have been removed:

team_desired survivors_walk_speed If you use the command z_spawn mob in Left 4 Dead 2, some of the Uncommon Infected that appear in that level will be mixed in with the regular Common Infected. The new weapons in Left 4 Dead 2 can be acquired using the following commands.

As all of the original Left 4 Dead weapons appear in Left 4 Dead 2, you can spawn all of them (except for the M1911 Pistol, which got replaced with P220s and Glocks!)

NOTE: Some melee weapons can only be spawned in certain campaigns. For instance, Crowbars cannot be spawned in "Swamp Fever" unless you edit the text files in your games directory to be able to do so.

give weapon_grenade_launcher // some people may have to rely on ent_create weapon_grenade_launcher give rifle_desert // Gives the Combat Rifle give rifle_ak47 give pistol_magnum give shotgun_chrome give shotgun_spas give sniper_military give smg_silenced give vomitjar // Bile bomb give defibrillator give electric_guitar give machete give frying_pan give katana give rifle_m60

You can also use the console to give your weapon any of the three upgrades in Left 4 Dead 2.

upgrade_add LASER_SIGHT upgrade_add explosive_ammo upgrade_add INCENDIARY_AMMO

The explosive ammo can be modified with the following commands. Setting one of the force commands too high will result in the game crashing.

upgrade_explosive_bullet_force // explosive force for all weapons other than shotguns upgrade_explosive_slug_force // explosive force for shotguns upgrade_show_explosive_ammo_radius // changing to 1 causes a sphere to be shown whenever an explosive shot is fired, showing its area of effect

The Special Infected new to Left 4 Dead 2 can also be spawned:

z_spawn spitter z_spawn jockey z_spawn charger

Playing any Mutation
The following commands will allow you to play any of the revealed Mutations with bots.

map mutation# //Replace # with a number: mutation1 = Last Man On Earth mutation2 = Headshot! mutation3 = Bleed Out mutation4 = Hard Eight mutation5 = Four Swordsmen mutation6 = Nothing mutation7 = Chainsaw Massacre mutation8 = Iron Man mutation9 = Last Gnome On Earth mutation10 = Room For One mutation11 = Healthpackalypse! mutation12 = Realism Versus mutation13 = Follow the Liter mutation14 = Gib Fest mutation15 = Versus Survival mutation16 = Hunting Party mutation17 = Lone Gunman mutation18 = Bleed Out Versus mutation19 = Taaannnkk! mutation20 = Healing Gnome community1 = Special Delivery community2 = Flu Season community3 = Riding My Survivor community4 = Nightmare community5 = Death Door community6 = Confogl rocketdude = Rocket Dude tankrun = Tank Run It is recommended that  is set to 1 if playing a competitive Mutation alone as the game will disconnect due to lack of players.

* Notice* Mutation called "Versus Survival" is playable on main menu.

Realism mode
Like with Survival mode, playing a single-player Realism mode in Left 4 Dead 2 is as follows:

map (map) realism

Force Uncommon Zombies
Type

z_forcezombiemodelname common_male_(Infected);z_forcezombiemodel 1;z_spawn

Replace (Infected) with the names below:

ceda = Hazmat CEDA zombies from Dead Center. jimmy = Jimmy Gibbs zombie from Dead Center's last level. fallen_survivor = The Fallen Survivor from The Passing. clown = Clowns from Dark Carnival. mud = Mud-Men from Swamp Fever. riot = Riot Cops from The Parish. worker = Workers from Hard Rain.

If you use the Fallen Survivor, you might want to use these:

z_fallen_kill_suppress_time 1 z_fallen_max_count 30

Complete list of commands
See: Complete list of console commands

Bots copy actions
You could manipulate the actions your CPU-controlled allies and the CPU-controlled Special Infected (Special Infected who are playable in Versus Mode). Every movement you make will be followed by these bots, thus negating their A.I. functionality. These are all applied with the console command  The command is quite self explanatory - every movement you make affects the movement of the bots, you shoot, the bots shoot (in the case of Special Infected, using their Special abilities is the equivalent of shooting), you walk forward, they also walk forward. This is a strategy if you want to direct the actions of the bots around you. Such as when you are ridden by a Jockey, this console command allows you to control both your player and the Jockey itself!
 * When this command is enabled, the human player cannot use items, pick up weapons, etc. (deactivating the Use key), it is up to them to direct the bots to the items, since they can do it instead.