37 lines
918 B
Plaintext
37 lines
918 B
Plaintext
|
#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;
|
||
|
}
|