Your server does auto restart on crash, so running "quit" from server console should make it restart. Try it. "sm_rcon quit" from client.
It is not in case the server crashes, when the lag (players ping) on the server starts to increase, and according to my experience, lag starts when the minimum uptime exceeds 9 hours. So I want the Server to auto restart when the uptime Time is 10 hours.
@Darkwob, give us "yes" or "no" answer.
Does your server start back up, even you quit server ?
*edit
There is [ANY] Server Crontab
You can schedule server shutdown(s) with this also.
Now this plugin works the way I want, but after talking to a friend from Germany, I ask if we can make this plugin automatically restart when it reaches a certain uptime, if there is no admin on the server.
// Get UNIXTIME, compensate with local time, today's 5:00 - current time
DBResultSet query = SQL_Query(MyDataBase, "SELECT strftime('%s','now','start of day','+1 day','+5 hours','-5 seconds','utc')");
int seconds = SQL_FetchInt(query, 0);
// Get UNIXTIME, compensate with local time, today's 5:00
DBResultSet query = SQL_Query(MyDataBase, "SELECT strftime('%s','now','start of day','+5 hours','-1 seconds','utc')");
timestamp = SQL_FetchInt(query, 0);
int timeleft = timestamp - GetTime();
//PrintToServer("seconds %i", timeleft);
switch(timeleft)
{
case 900:
{
PrintToChatAll("[SM] Server restart in %i minutes", timeleft / 60);
}
case 600:
{
PrintToChatAll("[SM] Server restart in %i minutes", timeleft / 60);
}
case 10:
{
PrintToChatAll("[SM] Server restart in %i seconds", timeleft);
}
case 5,4,3,2,1:
{
PrintToChatAll("%i", timeleft);
}
case 0:
{
PrintToChatAll("[SM] Server restart Now!");
}
}
if(timeleft <= 0)
{
Start();
for(int i = 1; i <= MaxClients; i++)
{
if(!IsClientInGame(i) || IsFakeClient(i)) continue;
ReconnectClient(i);
}
return Plugin_Stop
}
return Plugin_Continue;
}
Can someone fix this for SM 1.11? Ty
L 06/30/2022 - 16:59:06: [SM] Exception reported: Current result set has no fetched rows
L 06/30/2022 - 16:59:06: [SM] Blaming: restart.smx
L 06/30/2022 - 16:59:06: [SM] Call stack trace:
L 06/30/2022 - 16:59:06: [SM] [0] SQL_FetchInt
L 06/30/2022 - 16:59:06: [SM] [1] Line 22, restartann.sp::Start
L 06/30/2022 - 16:59:06: [SM] [2] Line 11, restartann.sp::OnPluginStart