SA-MP Forums Archive
Server restart - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Server restart (/showthread.php?tid=389767)



Server restart - Larry123 - 03.11.2012

Hello

How to do a system where server restarts in every automatically when it is 04:00 o`clock?


Re: Server restart - DBan - 03.11.2012

You could use https://sampwiki.blast.hk/wiki/Gettime and then just check if the variable hour is 4.


Re: Server restart - Glad2BeHere - 03.11.2012

pawn Код:
//put under gamemode int
SetTimer("RestartServer", 1000, true);//checks to see if its the 4th hour of the day every second
//put at the top
forward RestartServer();
//somewhere at the bottom
public RestartServer()
{
  new Hour, Minute, Second;
  gettime(Hour, Minute, Second);
  if(Hour == 4)
  {
  SendRconCommand("gmx");
  }
  return 1;
}