11.11.2012, 13:53
I have a restart command, and everything works fine. Problem is, 50% of the time, it will freeze everyone's game and forces them to crtl alt delete and kill the process. What's the problem? I have nothing in OnGameModeExit, and that's the only thing I could figure would cause a problem that's caused when "gmx" is called, because my restart command is on a timer to save everything..
That's it..
pawn Code:
public UpdateRestartTimer ( )
{
TimeLeftUntilRestart_Sec --;
if( TimeLeftUntilRestart_Sec <= 0 )
{
TimeLeftUntilRestart_Min --;
TimeLeftUntilRestart_Sec = 60;
}
if( TimeLeftUntilRestart_Min > 1 || TimeLeftUntilRestart_Min == 0 )
{
format( Timerstr, 64, "~w~%d minutes %d seconds", TimeLeftUntilRestart_Min, TimeLeftUntilRestart_Sec );
}
else
{
format( Timerstr, 64, "~w~%d minute %d seconds", TimeLeftUntilRestart_Min, TimeLeftUntilRestart_Sec );
}
TextDrawSetString( UpdateTimerAnn2, Timerstr );
TextDrawHideForAll( UpdateTimerAnn2 ), TextDrawShowForAll( UpdateTimerAnn2 );
if( TimeLeftUntilRestart_Min < 1 && TimeLeftUntilRestart_Sec == 10 )
{
for( new u; u < MAX_PLAYERS; u ++ )
{
OnPlayerDisconnect( u, 1 );
TogglePlayerControllable( u, false );
}
SendClientMessageToAll( C_RoyalBlue, "-- Restarting in 10 seconds; saving stats." );
}
return true;
}
public RestartTheServer ( )
{
TimeLeftUntilRestart_Min = 0;
TimeLeftUntilRestart_Sec = 0;
SendRconCommand( "gmx" );
return true;
}