Change cvar mapcyclefile on each map and write 1 map in it should force the game to reload mapcycle and to use that map.
PHP Code:
#include < amxmodx >
#pragma semicolon 1
#define PLUGIN ""
#define VERSION "0.0.1"
#define cm(%0) ( sizeof(%0) - 1 )
new const SERVERINFO_MAPCYCLEFILE[] = "ourmapcyclefile";
// use 2 files : amx_nextmap1.txt and amx_nextmap2.txt, so the 11th char change in the name
new g_szMapCycleFile[] = "amx_nextmap1.txt";
public plugin_init()
{
register_plugin( PLUGIN, VERSION, "ConnorMcLeod" );
// better to do that here rather than in intermission callback
ChangeMapCycleFile();
register_event("30", "Event_SVC_INTERMISSION", "a");
}
ChangeMapCycleFile()
{
get_localinfo(SERVERINFO_MAPCYCLEFILE, g_szMapCycleFile, charsmax(g_szMapCycleFile));
if( g_szMapCycleFile[11] == '1' )
{
g_szMapCycleFile[2] = '2';
}
else
{
g_szMapCycleFile[2] = '1';
}
set_cvar_string("mapcyclefile", g_szMapCycleFile);
}
public Event_SVC_INTERMISSION()
{
new szNextMap[32];
// write here some code to choose your next map
// when it is done, write its name in the .txt file.
// GetNextMap(szNextMap, charsmax(szNextMap));
new fp = fopen(g_szMapCycleFile, "wt");
fprintf(fp, "%s^n", szNextMap);
fclose(fp);
}
__________________