Half-Life Console Commands and Variables

Category: tfc

Use these console commands and variables to customize Half-Life, TFC, Opposing Force, or most HL Mods, troubleshoot problems with video or sound hardware, optimize performance, or make your own scripts. If you don't know how to use these console commands and variables, please see the Console Tutorial. Many of these variables are boolean, which means that they can be either 1 (on) or 0 (off) and no other values are allowed. In the descriptions for boolean variables, I use "enables" or "disables" to indicate what happens when that variable is set on (1). The opposite is always true (if 1 enables the feature, 0 disables it, and vice-versa). Variables that can accept any number as a value have descriptions that begin with "sets the . . . " 

Be sure to check out the other categories, especially the tweaks!. The flags listed at the end of the descriptions of some variables have the following meanings: 

  • a - attribute variable, changes to these variables will be automatically saved to Half-Life/valve/config.cfg (or Half-Life/tfc/config.cfg for TFC). Variables without this flag will return to the default value listed unless set by Half-Life/valve/autoexec.cfg (or Half-Life/tfc/autoexec.cfg for TFC).
  • i - info variable, the values of these variables are displayed in response to the info command. 
  • sv - server info variable, the values of these variables are displayed in response to the serverinfo command. 
  • tfc - team fortress classic variables, these variables apply to TFC mode only (hl.exe -game tfc). 
All · Audio · Cheats · Controls · DemoUtils · Developer · Help · Joystick · Misc · Mouse · Net · Prefs · Scripting · TFC · Tweaks · Unknown · Video
Command
or
Variable
Name
Arguments
or
Default
Description
+det20   set detpack to explode in 20 sec (must hold until it says ok) TFC Demo class only [Flags: tfc]
+det5   set detpack to explode in 5 sec (must hold until it says ok) TFC Demo class only [Flags: tfc]
+det50   set detpack to explode in 50 sec (must hold until it says ok) TFC Demo class only [Flags: tfc]
+gren1   launch grenade type 1 (see primeone, primetwo, throwgren) [Flags: tfc]
+gren2   launch grenade type 2 (see primeone, primetwo, throwgren) [Flags: tfc]
build   display build menu (ammo dispenser or sentry gun, Engineer class only) [TFC] [Flags: tfc]
changeclass   display class change menu (can use slotX to select from menu) [Flags: tfc]
changeteam   display team change menu (can use slotX to select from menu) [Flags: tfc]
cr_demoman 0 set a TFC class restriction to limit the number of players of the class in the name. 0=unlimited, -1=none of that class allowed [Flags: sv tfc]
cr_engineer 0 set a TFC class restriction to limit the number of players of the class in the name. 0=unlimited, -1=none of that class allowed [Flags: sv tfc]
cr_hwguy 0 set a TFC class restriction to limit the number of players of the class in the name. 0=unlimited, -1=none of that class allowed [Flags: sv tfc]
cr_medic 0 set a TFC class restriction to limit the number of players of the class in the name. 0=unlimited, -1=none of that class allowed [Flags: sv tfc]
cr_pyro 0 set a TFC class restriction to limit the number of players of the class in the name. 0=unlimited, -1=none of that class allowed [Flags: sv tfc]
cr_random 0 set a TFC class restriction to limit the number of players of the class in the name. 0=unlimited, -1=none of that class allowed [Flags: sv tfc]
cr_scout 0 set a TFC class restriction to limit the number of players of the class in the name. 0=unlimited, -1=none of that class allowed [Flags: sv tfc]
cr_sniper 0 set a TFC class restriction to limit the number of players of the class in the name. 0=unlimited, -1=none of that class allowed [Flags: sv tfc]
cr_soldier 0 set a TFC class restriction to limit the number of players of the class in the name. 0=unlimited, -1=none of that class allowed [Flags: sv tfc]
cr_spy 0 set a TFC class restriction to limit the number of players of the class in the name. 0=unlimited, -1=none of that class allowed [Flags: sv tfc]
detdispenser   remotely detonate ammo dispenser (TFC Engineer class only) [Flags: tfc]
detsentry   remotely detonate sentry gun (TFC Engineer class only) [Flags: tfc]
discard   drop unusable ammo -- bind a key to this and USE it in TFC every time you load up -- your teammates will thank you! [Flags: tfc]
dropitems   drop the flag (useful for handing it off to a teammate)
feign   fake a death noise and then feign death (Spy class only) [Flags: tfc]
flaginfo   display flag status (TFC) [Flags: tfc]
invlast   select the previously selected inventory item or weapon [Flags: tfc]
lastinv   switch back to last item or weapon used [Flags: tfc]
map <mapname>  change to map half-life\tfc\mapname.bsp (.bsp not required) -- will disconnect any clients on the server, see changelevel and changelevel2 to change maps without disconnecting clients
menuselect <X> select menu item X (useful after bringing up your class special menu with 'special' or '+attack2' or 'build') [Flags: tfc]
primeone   prime grenade type 1 (same at pressing, but not releasing the key bound to +gren1) [Flags: tfc]
primetwo   prime grenade type 2 (same at pressing, but not releasing the key bound to +gren2) [Flags: tfc]
saveme   call for medic (TFC) [Flags: tfc]
sfeign   feign death silently (TFC Spy class only) [Flags: tfc]
special   displays the "special" menu for a class, like +attack2 but lag-resistant (choose menu item with 'menuselect X') [Flags: tfc]
tfc_adminpwd 0 set TFC administrator password ** not functional ** [Flags: sv tfc]
tfc_autokick_time 180 set timeout inactivity limit [Flags: tfc]
tfc_autoteam 0 enable forced auto-team selection [Flags: sv tfc]
tfc_balance_scores 1 enable automatic team balancing by score [Flags: sv tfc]
tfc_balance_teams 1 enable automatic team balancing by number of players [Flags: sv tfc]
tfc_birthday 0 enable 'birthday' mode (explosives appear as presents) [Flags: tfc]
tfc_clanbattle 0 enable TFC clan battle (tournament) mode [Flags: sv tfc]
tfc_clanbattle_ceasefire 0 enable ceasefire mode if tfc_clanbattle = 1 [Flags: tfc]
tfc_clanbattle_locked 0 enable locked (play) mode if tfc_clanbattle = 1 [Flags: sv tfc]
tfc_clanbattle_prematch 0 enable prematch (practice) mode if tfc_clanbattle = 1 [Flags: tfc]
tfc_fragscoring 0 enable inclusion of frags (and not just captures or area control) in team scores [Flags: tfc]
tfc_respawndelay 0 set respawn delay for TFC games [Flags: sv tfc]
tfc_spam_limit 20 set number of messsages per time (minute?) that will cause spam penalty [Flags: tfc]
tfc_spam_penalty1 8 set spam penalty level 1 [Flags: tfc]
tfc_spam_penalty2 2 set spam penalty level 2 [Flags: tfc]
tf_weapon_ac   weapon name for "use " command; selects AutoCannon (TFC HW class only) [Flags: tfc]
tf_weapon_autorifle   weapon name for "use " command; selects Autorifle (TFC Sniper class only) [Flags: tfc]
tf_weapon_axe   weapon name for "use " command; selects Crowbar [Flags: tfc]
tf_weapon_flamethrower   weapon name for "use " command; selects Flame Thrower (TFC Pyro class only) [Flags: tfc]
tf_weapon_gl   weapon name for "use " command; selects Grenade Launcher (TFC Demo class only) [Flags: tfc]
tf_weapon_ic   weapon name for "use " command; selects Incendiary Cannon (TFC pyro only) [Flags: tfc]
tf_weapon_knife   weapon name for "use " command; selects Knife (TFC Spy class only) [Flags: tfc]
tf_weapon_medikit   weapon name for "use " command; selects Medikit (TFC Medic class only) [Flags: tfc]
tf_weapon_ng   weapon name for "use " command; selects Nailgun (TFC Sniper or Scout classes only) [Flags: tfc]
tf_weapon_pl   weapon name for "use " command; selects Pipe Launcher (TFC Demo class only) [Flags: tfc]
tf_weapon_railgun   weapon name for "use " command; selects Railgun (TFC Engineer class only) [Flags: tfc]
tf_weapon_rpg   weapon name for "use " command; selects Rocket Launcher (TFC Soldier class only) [Flags: tfc]
tf_weapon_sniperrifle   weapon name for "use " command; selects Sniper Rifle (TFC Sniper class only) [Flags: tfc]
tf_weapon_spanner   weapon name for "use " command; selects Spanner (wrench) (Engineer class only) [Flags: tfc]
tf_weapon_superng   weapon name for "use " command; selects Super Nailgun (TFC Medic class only) [Flags: tfc]
tf_weapon_supershotgun   weapon name for "use " command; selects Super Shotgun (TFC HW class only) [Flags: tfc]
tf_weapon_tranq   weapon name for "use " command; selects tranquilizer (TFC Spy class only) [Flags: tfc]
throwgren   throw the grenade type last primed with primeone or primetwo [Flags: tfc]
All · Audio · Cheats · Controls · DemoUtils · Developer · Help · Joystick · Misc · Mouse · Net · Prefs · Scripting · TFC · Tweaks · Unknown · Video