Half-Life Console Commands and Variables

Category: net

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
allowupload   toggle allowing upload of local copies of decals or models to server
bgetsv   request batch server list
bottomcolor 6 set the bottom color of your player model [Flags: a i]
clearlist   clear the server list
clientport 27005 set defail client port (TCP/IP) for connecting to a server (may specify other port with "connect ip:port")
cl_adaptive 0 displays time, dropped packet %, average latency, up/down rates, and FPS [Flags: a]
cl_allowdownload 1 enable download of maps, models, and decals on joining a server
cl_allowupload 1 enable upload of maps, models, and decals on joining a server
cl_allow_download   toggle allowing download of maps, models, and decals on joining a server
cl_allow_upload   toggle upload of maps, models, and decals on joining a server
cl_bitcounts   show list of bits received for each player, with delta values
cl_downloadinterval 1 set the minimum time between downloads from the server in a multiplayer game
cl_download_ingame 1 enable downloads during a multiplayer game (generally not a good thing -- instead set cl_allow_download 1 and this one to 0 so downloads are between maps only)
cl_download_max 0 set the maximum number of files to download from a server
cl_gaitestimation 1 enable estimated player stepping motion -- disable (0) to decrease apparent "ice skating" and possibly increase lag
cl_nodelta 0 disable delta compression (only set to 1 if you get network errors)
cl_nolerp 0 disable model (entity) movement prediction (1 may increase lag)
cl_nopred 0 disable client-side prediction (1 may increase lag) [Flags: a]
cl_predict_players 1 enable client-side prediction of other players
cl_pred_fraction 0.500 set client-side prediction faction (closer to one is more prediction) [Flags: a]
cl_pred_link 1 set client-side prediction link value
cl_pred_maxtime 255 set client-side prediction maximum prediction time [Flags: a]
cl_resend 6 set resend count (the number of times to attempt to resend packets)
cl_shownet 0 enable display of network packet numbers
cl_showsizes 0 enable display of network packet size graph
cl_spectator_password 0 set the password for spectator access to a server
cl_timeout 305 set the inactivity time before a client is disconnected (timed out) [Flags: a]
cl_upload_max 0 set the max number of files a client can upload to a server
connect <ip> : [port] connect to a miltiplayer server with ip address and optional 
coop 0 enable cooperative play mode see the coop link on the main page for tips on getting coop working) [Flags: sv]
disconnect   disconnect from a server or local game
download   start downloading files from server (if cl_download_ingame is 1)
fakelag 0 simulates lag, higher values are laggier
fakeloss 0 simulates packet loss, higher values are more lossy
fps_lan 31 set the max framerate for multiplayer games (only when rate is set higher than 5000. fps_modem sets the max framerate when rate is set lower than 5000). Lower reduces lag.
fps_modem 31 set the max framerate for multiplayer games (only when rate is set less than 5000. fps_lan sets the max framerate when rate is set 5000 or higher). Lower reduces lag.
getsv   for each server in the serverlist, list ip address and the total number of players connected
graphheight 64 set height of r_netgraph display
graphhigh 512 set max value of r_netgraph display
graphmean 1 set mean value of r_netgraph display
graphmedian 128 set median value of r_netgraph display
ipx_clientport 0 set client port for IPX LAN game
ip_clientport 0 set client port for TCP/IPLAN game
list   lists local servers found by slist command
name 0 set client player name [Flags: a i]
netbad   simulate a bad network connection
netmax   display maximum packets and maximum game packets
netusage 0 enable display of network usage graph
nextdl   download next file
pingservers   display pings of servers in the serverlist
pingsv <ip> : [port] ping server at IP:PORT address
port 27015 set the default connect port
protocol   display network protocol version
pushlatency -50 set pushlatency (try around -1/2 to -1 times ping) -- some people say using non-integer values (like -100.0521) reduces lag [Flags: a]
rate 9001.204 set client data rate (1000-4000 modem, 20000+ LAN) -- bad values cause LAG! turn on the r_netgraph to help avaluate different values, and try non-integers like 4001.0528. [Flags: a i]
reconnect   reconnect to the current server
retry   try reconnecting to the last server four more times (after four failed attempts)
r_netgraph 1 enable graph of network conditions (yellow is bad, red is worse) turn this on to evaluate rate settings and connection quality (1 is normal netgraph, 2 and 3 give more detailed packet info, but are harder to read)
showdrop 0 enable display of dropped packets
showinfo   enable display of all packets
showpackets 0 enable network packet info display
skipdl   skip the current download and move to the next (if any)
skipul   skip the current upload and move to the next (if any)
slist   search for local servers, store in serverlist
topcolor 30 set player model top color [Flags: a i]
upload   upload files to server
uprate 9999 set transfer rate from client to server (how many bytes per second your computer will try to send to the server). Lower may improve lag (to a point -- too low can be worse than too high)
All · Audio · Cheats · Controls · DemoUtils · Developer · Help · Joystick · Misc · Mouse · Net · Prefs · Scripting · TFC · Tweaks · Unknown · Video