24.04.2014, 11:56
hey guys I want a help, in how to make a timer for the cmd gmx I want the server to restart every 8 hours any one could help ?
forward restartGamemode();
public restartGamemode()
{
SendRconCommand("gmx");
return 1;
}
public OnGameModeInit()
{
SetTimer("restartGamemode", 28800000, false);
return 1;
}
you must set another timer into your function to tell the players that server will restart in next maybe 5 or 10 minuets ... and also increase the time to more than 12 hours ... bcoz it can be harmful and first your players will get angry ... second there is less data loss
![]() |
new hours,minutes;
forward restartGameMode();
public restartGameMode()
{
minutes++;
new string[100];
if(minutes == 60){
minutes = 0;
hours++;
}
if(hours == 24){
SendRconCommand("gmx");
hours = 0;
}
if((minutes % 5) == 0){
format(string,sizeof(string),"%d minutes remaining in the restart!",1440-minutes);
SendClientMessageToAll(0xFF8800,string);
}
}
SetTimer("restartGameMode",1000*60,1);