Untested
Code:
#include < amxmodx >
#include < amxmisc >
new g_pluginInformations[ 3 ][ ] =
{
"Rever to map",
"1.0",
"De{a}gLe"
}
new g_maxClients;
new g_pMapName, g_pMinClients;
public plugin_init( )
{
register_plugin( g_pluginInformations[ 0 ], g_pluginInformations[ 1 ], g_pluginInformations[ 2 ] );
g_pMapName = register_cvar( "amx_rtm_mapname", "de_dust2" );
g_pMinClients = register_cvar( "amx_rtm_minclients", "0" );
g_maxClients = get_maxplayers( );
set_task( 60.0, "taskCheckClients", 0, _, _, "b" );
}
public taskCheckClients( )
{
new minClients = get_pcvar_num( g_pMinClients );
if( g_maxClients <= minClients )
{
static mapName[ 32 ];
get_pcvar_string( g_pMapName, mapName, sizeof mapName - 1 );
server_cmd( "amx_map %s", mapName );
log_amx( "[AMX][RTM] Map changed to %s (Clients %d/%d).", mapName, minClients, g_maxClients );
}
}