Posts
Wiki

exec

Standard Usage

Executes a config file relative to both /tf/cfg/ and /hl2/cfg/. Config files in /tf/cfg/ take precedence.

Syntax: exec <file>[.ext]

Valid values for <file>: The name of the script you wish to execute
Valid values for [.ext]: Optional extension for the script if it isn't a .cfg. Note that .txt aren't supported.

exec is invoked on certain game events:

EventCommand
Switching class to Scoutexec scout
Switching class to Soldierexec soldier
Switching class to Pyroexec pyro
Switching class to Demomanexec demoman
Switching class to Heavyexec heavyweapons
Switching class to Engineerexec engineer
Switching class to Medicexec medic
Switching class to Sniperexec sniper
Switching class to Spyexec spy
Entering Spectator modeexec spectator1

1: This file does not exist by default. Also, this doesn't seem to work.

Example Usage

exec scout

Reset All Binds

config_default.cfg resets all binds to their defaults (this file gets executed the first time a user runs the engine without a config.cfg)

Example Usage

exec config_default