#include <amxmodx>
public plugin_init()
register_plugin("Plugins Controller", "1.0", "neygomon");
public plugin_cfg()
{
new fp = fopen("addons/amxmodx/configs/plugins_controller.ini", "rt");
if(!fp) set_fail_state("File ^"addons/amxmodx/configs/plugins_controller.ini^" NOT read!");
new buff[32];
new map[32], parsemap[32]; get_mapname(map, charsmax(map));
new bool:bStopped;
new iNumPlugins;
while(!feof(fp))
{
fgets(fp, buff, charsmax(buff)); trim(buff);
if(!buff[0] || buff[0] == ';') continue;
if(buff[0] == '[' && buff[1] == '/' && bStopped) break;
if(buff[0] == '[')
{
strtok(buff[1], parsemap, charsmax(parsemap), buff, 1, ']');
if(!strcmp(parsemap, map))
bStopped = true;
continue;
}
if(bStopped)
{
if(!strcmp(buff[strlen(buff)-5], ".amxx"))
{
pause("cd", buff);
log_amx("Map %s | Plugin %s stopped", map, buff);
iNumPlugins++;
}
}
}
fclose(fp);
if(bStopped) log_amx("Map %s | Stopped %d plugins AND himself stopped", map, iNumPlugins);
else log_amx("Map %s | Plugins not stopped. Himself stopped", map);
pause("ad");
}