This plugin executes map specific commands an can be configured in great detail.
Commands and CVars:
amx_mapcfg will execute the map specific configuration when the cmd is exec'ed by an admin with ADMIN_CFG level.
amx_mapcfg_execed add this to your config.cfg. The script waits for this cvar to become 1 b4 it does anything automatically, so it can wait for your server.cfg to be executed.
All commands for the maps are stored in a general config file (default: addons/amxmodx/config/mapcommands.txt). If this does not exists by the time the script is executed, it will be created and commented a little.
To setup the map config file, you need to specify the following:
Map names can be specified two ways, open map name and closed map name. This means:
Open map names are defined by putting [mapname into a line. This is used to give commands that are executed on every map whose name starts with the given string, for example:
[fy_ <-- no closing bracket!!!
commands that follow this map name will be executed on fy_pool_day, fy_iceworld, fy_iceworld2k, fy_whathaveyou.
Closed Map names are names that have to be fully equal with the name of the map currently running. For example:
[fy_iceworld] <-- notice the closing bracket!!!
those commands will only be executed on fy_iceworld but NOT on fy_iceworld2k.
There are several directives telling the script where to execute the commands:
#all means that the commands following after this lines are both executed server- and clientside.
#server means that those commands are only executed serverside (this is the default if none is specified).
#client means that these commands are only executed clientside.
Listen servers are not handled the normal way, because they are identical to the first player in the server, so commands being sent to #client would be executed on the server as well, and those sent to #all would be sent to the server twice. To avoid this, the script detects listen servers and does not send the command to the user with uID #1.
But if you do intend to send the command to everybody even if the server will receive the command (twice), you have to use the following directives:
All commands that follow such a line are affected by it, the dedicated server will just ignore them. Commands that come after an '#ignorelisten on' line will be sent so all clients no matter what, #ignorelisten off switches back to normal.
To write a comment, you have to put // to the beginning of the line. Comments are only regarded as such if this token is right at the beginning, lines like
#server // bla
will cause the script to react awkwardly!
I didn't use any mod specific code but yet I have to admit I only tested it on CS 1.6, but I think other mods should work as well...
Attached to this post you will find an example command file which only gives you a couple of messages on the console, but I suppose you know what to do after you read it...
BTW: Double quotes inside the command lines are allowed.