well, i've been looking for a simple way to make it work, and now i've made something very simple using
PTaH extention.
how it works?
this is very simple just follow the steps:
1- make an autoupdate script:
- this is what i use for server crash but it can also used to make your server update it's self on server quit :
2- Server update detection:
- it's also very simple , just use PTaH and The attached plugin so your server will get the first chance to update it's self!
Spoiler
PHP Code:
#pragma semicolon 1
#include <PTaH>
public Plugin myinfo =
{
name = "Server Auto-Update Detector",
author = "noBrain",
version = "1.2",
};
public void OnPluginStart()
{
RegConsoleCmd("say", Command_Say);
RegConsoleCmd("say_team", Command_Say);
PTaH(PTaH_ServerConsolePrint, Hook, ServerConsolePrint);
}
public Action ServerConsolePrint(const char[] sMessage)
{
int Players = GetClientCount(false);
if (StrContains(sMessage, "MasterRequestRestart") != -1 && Players == 0)
{
PrintToServer("[SM] An Update Detected ! Restarting Server In 5 Seconds!");
PrintToChatAll("[SM] An Update Detected ! Restarting Server In 5 Seconds!");
ServerCommand("quit");
}
return Plugin_Continue;
}
public Action Command_Say(int client, int args)
{
char Message[512];
GetCmdArgString(Message, sizeof(Message));
if(StrContains(Message, "MasterRequestRestart") != -1)
{
PrintToChat(client, "[SM] Blocked Expression.");
return Plugin_Handled;
}
return Plugin_Continue;
}
so that's it, your server will update it self each time!
NOTE : i've blocked players from typing MasterRequestRestart , cause it can be used by players to shutdown your server and also your server needs to be empty to get updated ..
this way might look very noobish but at least it's what's possible for windows (or what i know
).