Half-Life Console Commands and Variables

Category: controls

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
+attack   fire
+attack2   alternate fire (Special Ability Menu in TFC) see special
+back   move backward
+camdistance   move chase cam away from player (only works if thirdperson activated)
+camin   move chase cam in (forward) only works if thirdperson activated
+cammousemove   allow mouse motion to control chase cam while held down (only works if thirdperson activated)
+camout   move chase cam out (back) only works if thirdperson activated
+campitchdown   decrease chase cam pitch (aim down) only works if thirdperson activated
+campitchup   increase chase cam pitch (aim up) only works if thirdperson activated
+camyawleft   yaw (tilt) chase cam left (only works if thirdperson activated)
+camyawright   yaw (tilt) chase cam right (only works if thirdperson activated)
+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]
+duck   duck (a.k.a. crouch)
+forward   move forward
+gren1   launch grenade type 1 (see primeone, primetwo, throwgren) [Flags: tfc]
+gren2   launch grenade type 2 (see primeone, primetwo, throwgren) [Flags: tfc]
+jlook   enable joystick-controlled looking around (like +mlook, but with a joystick)
+jump   jump
+klook   use keyboard to look around (see +mlook, +jlook))
+left   turn left
+lookdown   look down
+lookup   look up
+mlook   use mouse to look around
+movedown   move down -- as in swim down, fly down, or climb down
+moveleft   strafe left
+moveright   strafe right
+moveup   move up -- as in swim up, fly up, or climb up
+reload   reload current weapon
+right   turn right
+showscores   show pings and scores for all players on the server
+speed   walk if autorun enabled, run if autorun disabled
+strafe   strafe modifier, direction keys strafe while this is held down
+use   use item (switch, scientist, sentry gun, …)
build   display build menu (ammo dispenser or sentry gun, Engineer class only) [TFC] [Flags: tfc]
centerview   centers the view
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]
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)
escape   same as [ESCAPE] key, hides console, cancels selection, etc.
feign   fake a death noise and then feign death (Spy class only) [Flags: tfc]
flaginfo   display flag status (TFC) [Flags: tfc]
force_centerview   snaps player view to straight ahead
hideconsole   hide the console
impulse 100  enable flashlight
invlast   select the previously selected inventory item or weapon [Flags: tfc]
invnext   select next item in inventory
invprev 0 select previous item in inventory
kill   suicide
lastinv   switch back to last item or weapon used [Flags: tfc]
messagemode   prompt for a chat message to send to all clients connected to the server
messagemode2   prompt for a chat message to send to your teammates only
pause   pause game
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]
slot1   select weapon group 1 (or menu item 1) see use
slot10   select weapon group 10 (or menu item 10) see use
slot2   select weapon group 2 (or menu item 2) see use
slot3   select weapon group 3 (or menu item 3) see use
slot4   select weapon group 4 (or menu item 4) see use
slot5   select weapon group 5 (or menu item 5) see use
slot6   select weapon group 6 (or menu item 6) see use
slot7   select weapon group 7 (or menu item 7) see use
slot8   select weapon group 8 (or menu item 8) see use
slot9   select weapon group 9 (or menu item 9) see use
special   displays the "special" menu for a class, like +attack2 but lag-resistant (choose menu item with 'menuselect X') [Flags: tfc]
spectator 0 enter spectator mode if enabled [Flags: i]
s_verbwet 0.250 controls the wet/dry mix of reverbfor A3D only. The higher the number, the more wet (more reverb) the sounds. Valid range is 0 to 1.0 [Flags: a]
tell <playername> "message" sends "message" to the console of player "playername" only. unless that player has developer set to 1 or the console open, they won't see it.
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]
toggleconsole   toggle the console screen
use <item> use an item, i.e. "use tf_weapon_axe" or "use weapon_snark"
weapon_357   weapon name for "use " command; selects .357 magnum pistol (not for TFC, see tf_weapon_* for TFC weapon names)
weapon_9mmAR   weapon name for "use " command; selects 9mm Assault Rifle (not for TFC, see tf_weapon_* for TFC weapon names)
weapon_9mmhandgun   weapon name for "use " command; selects 9mm Pistol (not for TFC, see tf_weapon_* for TFC weapon names)
weapon_crossbow   weapon name for "use " command; selects Crossbow (not for TFC, see tf_weapon_* for TFC weapon names)
weapon_crowbar   weapon name for "use " command; selects crowbar (not for TFC, see tf_weapon_* for TFC weapon names)
weapon_egon   weapon name for "use " command; selects Egon Gun (not for TFC, see tf_weapon_* for TFC weapon names)
weapon_gauss   weapon name for "use " command; selects Gauss Gun (not for TFC, see tf_weapon_* for TFC weapon names)
weapon_handgrenade   weapon name for "use " command; selects Hand Grenades (not for TFC, see tf_weapon_* for TFC weapon names)
weapon_hornetgun   weapon name for "use " command; selects Hornet Gun (not for TFC, see tf_weapon_* for TFC weapon names)
weapon_rpg   weapon name for "use " command; selects Rocket Launcher (not for TFC, see tf_weapon_* for TFC weapon names)
weapon_satchel   weapon name for "use " command; selects Satchel Charge (not for TFC, see tf_weapon_* for TFC weapon names)
weapon_shotgun   weapon name for "use " command; selects Shotgun (not for TFC, see tf_weapon_* for TFC weapon names)
weapon_snark   weapon name for "use " command; selects Snarks (not for TFC, see tf_weapon_* for TFC weapon names)
weapon_tripmine   weapon name for "use " command; selects Tripmines (not for TFC, see tf_weapon_* for TFC weapon names)
All · Audio · Cheats · Controls · DemoUtils · Developer · Help · Joystick · Misc · Mouse · Net · Prefs · Scripting · TFC · Tweaks · Unknown · Video