Okay. First things first, I should say that this is my first real plugin so go easy on me. This is a modified version (as seen below) of the AMX Mod Change Map Configs plugin. I ported it and made a major change. I used regex so that if you are on a surf map, it loads surf.cfg and if you are not, it loads normal.cfg.
Obviously, settings for FY and other types of maps can can be added as well. Feel free to give suggestions. In fact, please give me as many suggestions as possible for improving this script including, perhaps, a way to add types of maps without having to recompile the SMA every time you want to add a new type.
Oh, yes. There was one thing that I must ask - When modifying the script, there was a variable called 'len' which was uncalled throughout the plugin. If anyone can suggest how to change the line(s) with 'new len' in them, please do.
Thanks for any advice to make this more efficient.
This has been tested and works flawlessly on my server.
/* AMX Mod X script.
* Map Configuration Switcher 1.0.0
* Set map-specific variables and commands
* Originally by JustinHoMi ([email protected])
* Modified by Atreus ([email protected])
* Place your custom configs in the designated folder
* (addons\amxmodx\configs by default)
* Configs should be in the format "mapname.cfg"
* Insert any cvar or cmd to be executed at map change
* 1.0.0 - Completely reworked the script.
- Updated to AMXX.
- When on a surf map, uses "surf.cfg". When on a non surf map, uses "normal.cfg".
* 0.9.9 - Added translations support for AMX Mod 0.9.9
* 0.61 - Changes load delay to 6s (to work better with SQL ServerCfg)
* 0.6 - Execs configs rather than loading file
* - Delays execution for 5s after map changes
* 0.5 - Initial release