Alangara_PRC8/_module/nss/mn_dmrestartwand.nss
Jaysyn904 86feb9ca6f Initial commit
Initial commit.
2024-06-05 21:21:06 -04:00

58 lines
1.5 KiB
Plaintext

// Reload module script
// Scripted for Xymoria server
// By -Seeker-
// Made for implementation with tagbased item-activation
// This script allows only a DM to restart the server.
#include "x2_inc_switches"
void main()
{
int nEvent = GetUserDefinedItemEventNumber();
object oPC;
object activatedObject;
string message;
// Item unique power activated
if (nEvent == X2_ITEM_EVENT_ACTIVATE)
{
oPC = GetItemActivator();
if (GetIsDM( oPC ) || GetIsDMPossessed( oPC ) )
{
// Activated by DM
message = "* Server was reset by DM: Acc:"+GetPCPlayerName( oPC );
message += " Playername: "+GetName(oPC);
// Write log in logfile
WriteTimestampedLogEntry( message );
// Restart module
StartNewModule("ALANGARA - Where gods are born");
}
else
{
// Activated by Player
message = "*** Warning! Attempted illegal reset by Acc: "+GetPCPlayerName( oPC );
message += " Playername; "+GetName(oPC)+" ***";
activatedObject = GetItemActivated();
// Write log in logfile
WriteTimestampedLogEntry( message );
// Send message to DMs
SendMessageToAllDMs( message );
// Warn player
SendMessageToPC(oPC, "You are not allowed to use this wand! It has been removed");
// Destroy wand
SetPlotFlag( activatedObject , FALSE );
DestroyObject( activatedObject );
}
}
}