PDA

View Full Version : Server restart


Larry123
03/11/2012, 01:35 PM
Hello

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

DBan
03/11/2012, 01:49 PM
You could use http://wiki.sa-mp.com/wiki/Gettime and then just check if the variable hour is 4.

Glad2BeHere
03/11/2012, 02:40 PM
//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;
}