UptimeRestarts: forgot to save uptime on new restart
This commit is contained in:
parent
e27a18d42b
commit
dc04b21eb4
@ -211,6 +211,15 @@ public Action RestartCountdown(Handle timer)
|
|||||||
|
|
||||||
public void ForceRestart()
|
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.");
|
LogToFile("addons/sourcemod/logs/restarts.txt", "Successfully force-restarted the Server.");
|
||||||
ServerCommand("_restart");
|
ServerCommand("_restart");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user