Using Metamod =-=-=-=-=-=-= Client Commands =============== Similar to the server console interface, clients can also issue commands to Metamod, of the following form: - meta version - displays version information about the Metamod instance currently running on the server, ie: Metamod v1.21p38 2018/02/11 (5:13) by Will Day http://www.metamod.org/ Patch: Metamod-P (mm-p) v38 by Jussi Kivilinna http://koti.mbnet.fi/axh/ compiled: Feb 11 2017, xx:xx:xx EET (optimized) - meta list - displays information about the list of currently running plugins, ie: Currently running plugins: [ 1] Trace HLSDK API, v1.XX.93, 2003/02/17, by Will Day , see http://www.metamod.org/ [ 2] Adminmod, v2.50.56 (MM), Jul 13 2003, by Alfred Reynolds , see http://www.adminmod.org/ 2 plugins Client Cvars ============ Also available to client browser applications is a cvar metamod_version that should report the version of Metamod running on the server, ie: "metamod_version" is "1.21p38" Installation ============ If you want to install Metamod by hand, here's what you have to do: - Install the Metamod library (.dll for win32, or .so for linux) to a directory under your game directory. For instance, if you were running Counter-Strike, under win32 you might want have: half-life/cstrike/addons/metamod/dlls/metamod.dll If a directory you want doesn't exist, create it. - Edit the "liblist.gam" file in your game directory, replacing the game dll filename with the Metamod dll filename. For instance with Counter-Strike, you would change: gamedll "dlls/mp.dll" gamedll_linux "dlls/cs.so" to: gamedll "addons/metamod/dlls/metamod.dll" gamedll_linux "addons/metamod/dlls/metamod.so" Note that it's only really necessary to change the line corresponding to your OS (win32 or linux); you can leave the other line unchanged, or you can change it - it doesn't matter. - To load plugins at game startup, you'll need to create a "plugins.ini" file containing a list of the plugins you want to load. Configuration ============= Metamod has several ways to provide config options, partially because it started with one method and then added other methods, but also because one method can be more convenient than the other, varying with the situation. Generally speaking, the two methods of providing configuration information to Metamod are: - on the command line, via +localinfo arguments to hlds. - as the contents of some file that Metamod reads and parses. The confusing part can come when the pathnames to some of the config files can be specified via command line options - or indeed, when the pathnames to some config files can be specified in other config files. In any case, here are the various config options and config files Metamod uses, (listed in order of priority), where "$gamedir" indicates the game directory, ie "cstrike": - +localinfo mm_configfile - +localinfo mm_pluginsfile - config.ini option: plugins_file - $gamedir/addons/metamod/plugins.ini - $gamedir/metamod.ini - $localinfo mm_execcfg - config.ini option: exec_cfg - $gamedir/addons/metamod/exec.cfg - $gamedir/metaexec.cfg - $localinfo mm_gamedll - config.ini option: gamedll - [DEL]$gamedir/metagame.ini[DEL] -- NO LONGER SUPPORTED. File: plugins.ini ===== Default location: _$gamedir/addons/metamod/plugins.ini, ie "cstrike/addons /metamod/plugins.ini". Plugins are described in a file "plugins.ini" and each line describes a plugin to load: [] Fields are whitespace delimited (tabs/spaces). - Platform is a keyword, either "linux" or "win32". - Filepath is a path to the DLL/so file. Relative paths are from the game dir; absolute paths are also valid. Paths should use unix-style forward slashes (/) and not backward slashes (\), even on windows platforms. Also, the filepath (once expanded to full path name) is expected to be unique within the list of plugins. Thus, a plugin with a fullpathname matching that of a previous plugin is considered a duplicate, and is not loaded. - Description is an optional description of the plugin, used in place of the plugin's internal name in log messages and console output. Whitespace in the description _is_ allowed; quoting is unnecessary. Comments are recognized at _only_ the beginning of a line, and can be in either shell style ("#") or c++ style ("//"). For instance, in "cstrike/addons/metamod/plugins.ini" these are all valid lines: // linux dlls/mybot.so # win32 dlls/mybot-old.dll Mybot old win32 dlls/mybot.dll Mybot current linux /tmp/stub_mm_i386.so win32 /tmp/stub_mm_i386.dll linux ../dlls/trace_mm_i386.so win32 ../dlls/trace_mm_i386.dll linux dlls/admin_MM_i386.so win32 dlls/admin_MM_i386.dll Note that order in the plugins.ini file _is_ significant. Plugins are loaded and accessed in the order specified, so ordering can be important, depending on the plugin(s). The file is re-read at changelevel, as well as on demand (via "meta refresh" console command; see below). When the file is re-read, it will: - load any new plugins added to the file - unload any plugins that have been deleted from the file. This is only applicable to plugins loaded _from the inifile_. If the plugin was loaded from the console, it will not be unloaded during a refresh, whether it's in the inifile or not. - reload any plugin whose file on disk has been updated since it was loaded. Note this appears to be only useful under linux, as under Windows you cannot rename or overwrite an open DLL, so it doesn't look a loaded plugin could ever have a newer file on disk. Oh well. The game dll is auto-detected, along the same lines AdminMod operated (looking at the "gamedir"); see "mm_gamedll" below if you want to use a "bot" DLL. You can override the name of this file by specifying it via the +localinfo field "mm_pluginsfile". For compatibility with previous versions, Metamod will also look for a file "metamod.ini" under the gamedir, ie "cstrike/metamod.ini". File: config.ini ===== Default location: _$gamedir/addons/metamod/config.ini, ie "cstrike/addons/ metamod/config.ini". This contains basic config information, at the moment duplicating most of the +localinfo variables, but allowing for more flexible expansion of config options in the future. Also, it provides somewhat more reliable options setting, since +localinfo munges some argument values (in particular, pathnames with leading dots, ie "../dlls/blah.dll"). Basic format is: