Ideally you should find the source of the problem instead of applying band-aids. Might be difficult though with the number of plugins you are running.
Untested
PHP Code:
#include <amxmodx>
#include <nvault>
new const Version[] = "0.1";
new g_pNumRounds;
public plugin_init()
{
register_plugin( "Server Restarter" , Version , "bugsy" );
new iVault = nvault_open( "server_restart" );
new szNextMap[ 64 ];
if ( nvault_get( iVault , "NextMap" , szNextMap , charsmax( szNextMap ) ) )
{
nvault_remove( iVault , "NextMap" );
nvault_close( iVault );
server_cmd( "changelevel ^"%s^"" , szNextMap );
return;
}
nvault_close( iVault );
g_pNumRounds = register_cvar( "server_restart_rounds" , "50" );
register_logevent( "RoundEnd" , 2 , "1=Round_End" );
}
public RoundEnd()
{
new iVault = nvault_open( "server_restart" );
new iNumRounds , szRounds[ 4 ] , szNextMap[ 64 ];
iNumRounds = nvault_get( iVault , "NumRounds" );
if ( ( iNumRounds + 1 ) >= get_pcvar_num( g_pNumRounds ) )
{
get_cvar_string( "amx_nextmap" , szNextMap , charsmax( szNextMap ) );
nvault_set( iVault , "NextMap" , szNextMap );
nvault_set( iVault , "NumRounds" , "0" );
nvault_close( iVault );
server_cmd( "restart" );
}
else
{
num_to_str( iNumRounds + 1 , szRounds , charsmax( szRounds ) );
nvault_set( iVault , "NumRounds" , szRounds );
nvault_close( iVault );
}
}
__________________