29.01.2011, 19:40
How to make auto-restart server (gmx) in 00:00 clock? Or after 24 hours?
forward restart(); public restart() { SendRconCommand("gmx"); return 1; } public OnGameModeInit() { SetTimer("restart",100*60*60*24,1); return 1; }
//
public OnPlayerUpdate(playerid)
{
new Hour, Min, Second;
gettime(Hour, Min, Second);
if(Hour == 23 && Min == 59)
{
SendRconCommand("gmx");
SendClientMessageToAll(0xDEEE20FF, "24 hours have passed, the server is restarted.");
}
return 1;
}
SetTimer("AutoRestart",30000,0);
forward AutoRestart();
public AutoRestart()
{
new h,m,s;
gettime(h,m,s);
if(h == 23 && m == 59)
{
print("Auto Restarting..");
SendRconCommand("gmx");
}
return 1;
}