Added server reset script

Added server reset script to rest conversation.
Full compile.
This commit is contained in:
Jaysyn904
2025-05-04 21:25:10 -04:00
parent b41f46eb49
commit 06a5578d2e
63 changed files with 820 additions and 84 deletions

View File

@@ -0,0 +1,36 @@
#include "nwnx_admin"
void RestartServer(object oSpeaker)
{
if (!GetIsDM(oSpeaker))
{
SendMessageToPC(oSpeaker, "You do not have permission to restart the server.");
return;
}
// Broadcast the restart message to all players
string sMessage = "SERVER RESTART IN 10 SECONDS! The server will be back up in approximately 15 minutes.";
SpeakString(sMessage, TALKVOLUME_SHOUT);
// Schedule the actual restart after 10 seconds
DelayCommand(10.0f, ExportAllCharacters());
DelayCommand(10.0f, NWNX_Administration_ShutdownServer());
}
void main()
{
object oSpeaker = GetPCSpeaker();
if (GetIsDM(oSpeaker))
{
SetPCChatMessage(""); // Clear the chat message
RestartServer(oSpeaker);
}
else
{
SendMessageToPC(oSpeaker, "You do not have permission to use this command.");
SetPCChatMessage("");
}
return;
}