/* AMX Mod script.
*
* Custom Map Configs 0.6
*  Set map-specific variables and commands
*
* by JustinHoMi (justin@justinmitchell.net)
*  http://www.modkillers.com
*  #modkillers in irc.gamesnet.net
*
* Place your custom configs in the designated folder
*  (addons/amx/map_configs by default)
* Configs should be in the format "mapname.cfg"
* Insert any cvar or cmd to be executed at map change
*
* Changelog:
*  0.6 - Execs configs rather than loading file
*        - Delays execution for 5s after map changes
*  0.5 - Initial release
*
*/

#include <amxmod>

new filepath[32] = "addons/amx/map_configs/"
new file_name[128]

public load_config(){
        new currentmap[28]

        get_mapname(currentmap,32)
        format(file_name,128,"%s%s.cfg",filepath,currentmap)
        if (file_exists(file_name))
                set_task(5.0,"delayed_load")
}

public delayed_load() 
        server_cmd("exec %s",file_name)
 
 
public plugin_init() {
   register_plugin("Map Configs","0.6","JustinHoMi")
   load_config()
   return PLUGIN_CONTINUE
}
