UptimeRestarts: forgot to save uptime on new restart

This commit is contained in:
dogan 2020-07-06 13:18:56 +02:00
parent e27a18d42b
commit dc04b21eb4

View File

@ -211,6 +211,15 @@ public Action RestartCountdown(Handle timer)
public void ForceRestart()
{
float fUptime = GetEngineTime();
g_fUptime = g_fUptime + fUptime;
char sUptime[64];
FloatToString(g_fUptime, sUptime, sizeof(sUptime));
File UptimeFile = OpenFile("uptime.txt", "w");
UptimeFile.WriteLine(sUptime);
delete UptimeFile;
LogToFile("addons/sourcemod/logs/restarts.txt", "Successfully force-restarted the Server.");
ServerCommand("_restart");
}