Use server commands to control your Team Fortress 2 server while it’s running: change the map, kick or ban players, adjust rules, or add bots. In this guide, we’ll show you where to enter commands and which ones you’re most likely to need.
In ZapX, open your server’s Console tab. Enter each command there without a slash, then press Enter to run it. The server’s response appears directly in the console.
Commands that change a setting (for example, mp_timelimit 20) only apply until the next restart. To make a setting permanent, add it to the custom.cfg file in the tf/cfg folder. Server Configuration explains how.
Your server resets the server name and password to the values in the Startup Parameters in the Configuration tab every time it starts. So hostname and sv_password in the console are only suitable for temporary changes.
To control your server remotely without opening the panel, use RCON.
| Command | Description |
|---|---|
status | Shows connected players, their user IDs, and connection information |
users | Shows user information for the connected players |
version | Shows the server’s version information |
stats | Shows basic server performance statistics |
find <suchtext> | Searches for console commands and variables whose name or description matches the search text |
You can find a player’s user ID, which you need for kick or banid, in the output of status.
| Command | Description |
|---|---|
changelevel <kartenname> | Switches to the specified map without restarting the server process |
map <kartenname> | Restarts the specified map and loads it as the current server map |
maps [filter] | Lists available maps, optionally filtered by search text, for example, maps pl_ |
nextlevel [kartenname] | Shows or sets the map for the next map change |
mapcyclefile [dateiname] | Shows or sets the map cycle file in use |
Set the map your server starts with using Starting Map in the startup parameters. For custom maps and Workshop maps, see Install Mods.
| Command | Description |
|---|---|
kick <spielername|userid> [grund] | Removes a player from the server |
banid <minuten> <userid> [kick] | Bans the user ID for the specified duration. Use kick to remove the player immediately |
removeid <steamid> | Removes the ban for the specified Steam ID |
listid | Shows saved bans by user ID |
writeid | Saves bans by user ID to the ban file |
addip <minuten> <ip-adresse> | Bans the specified IP address for the specified duration |
removeip <ip-adresse> | Removes the ban for the specified IP address |
listip | Shows saved IP bans |
writeip | Saves IP bans to the ban file |
say <nachricht> | Sends a message from the server to all players |
After banid or addip, also run writeid or writeip, respectively. The ban is only added to the ban file after you do this.
| Command | Description |
|---|---|
mp_timelimit [minuten] | Time limit per map in minutes |
mp_maxrounds [runden] | Maximum number of rounds per map |
mp_winlimit [runden] | Number of round wins a team needs to end the map |
mp_restartgame <sekunden> | Restarts the game after the specified delay |
mp_autoteambalance [0|1] | Automatically balances teams |
mp_teams_unbalance_limit [anzahl] | Permitted difference in the number of players on each team |
mp_friendlyfire [0|1] | Allows damage to teammates |
mp_allowspectators [0|1] | Allows spectators |
mp_forcecamera [0|1|2] | Determines which players a dead player can spectate |
mp_disable_respawn_times [0|1] | Disables respawn delays |
mp_respawnwavetime [sekunden] | Respawn wave time |
mp_waitingforplayers_time [sekunden] | Duration of the waiting period before the game starts |
mp_stalemate_enable [0|1] | Sudden-death phase in the event of a tie |
tf_weapon_criticals [0|1] | Random critical hits |
tf_damage_disablespread [0|1] | Disables random weapon damage spread |
sv_gravity [wert] | Gravity on the server |
sv_alltalk [0|1] | Voice chat across teams |
sv_voiceenable [0|1] | Voice chat on the server |
If you enter one of these commands without a value, the console shows you its current value.
| Command | Description |
|---|---|
tf_bot_quota [anzahl] | Target number of bots |
tf_bot_quota_mode [normal|fill|match] | Mode used to manage the number of bots |
tf_bot_difficulty [0|1|2|3] | Bot difficulty, from 0 (easy) to 3 (expert) |
To learn how to configure bots permanently, see Add Bots.
| Command | Description |
|---|---|
hostname [servername] | Shows or sets the server name until the next restart |
sv_password [passwort] | Shows or sets the server password until the next restart; an empty value removes it |
sv_cheats [0|1] | Allows cheat commands; useful for testing only |
exec <dateiname> | Runs the commands in a configuration file, for example, exec custom.cfg |
Don’t set sv_lan to 1. Your server will only be visible on the local network and won’t be accessible over the internet.
You now know the most important commands for controlling your Team Fortress 2 server while it’s running. For added convenience, such as an in-game admin menu, you can use SourceMod. See Become an Admin. If you have any other questions, our support team is available every day! 🙂