//Script Name: onclientexit ////////////////////////////////////////// //Created By: Genisys (Guile) //Created On: 5/20/08 (Updated 8/10/08) ///////////////////////////////////////// /* This script goes in your OnClientExit Module Properties Event for this event */ //////////////////////////////////////// //Required Include for SimTools #include "hgll_func_inc" //PROTOTYPE DECLARED void SendMessageToAllPC(string sMessage); //This is used to send messages to all //PCs on the module ///////////////////////////////////////// //Main Script void main() { object oPC = GetExitingObject(); if(GetIsDM(oPC)) {return; } //Prevent Accidental Death Logging for any reason! //If they are truly dead, then set them as dead for when they return! if(GetIsDead(oPC)) { //Make sure we record this kind of action... WriteTimestampedLogEntry(GetName(oPC) + " LOGGED OUT TO CHEAT DEATH " + GetPCPublicCDKey(oPC, FALSE) + " " + GetPCPlayerName(oPC)); SendMessageToAllDMs(GetName(oPC) + " HAS LOGGED OUT TO CHEAT DEATH"); } //Higher Ground's Legendary leveler object PC = GetExitingObject(); object M = GetModule(); string Script = GetLocalString(PC, "LetoScript"); if( Script != "" ) { SetLocalString(PC, "LetoScript", ""); LetoScript(Script); } ///////////////////////////////////////////////////////////// if(!GetIsPC(oPC)) return; location lSaved = GetLocation(oPC); string sLeave; sLeave = GetName(oPC); sLeave += " / "; sLeave += GetPCPlayerName(oPC); sLeave += " / "; sLeave += GetPCIPAddress(oPC); sLeave += " / "; sLeave += GetPCPublicCDKey(oPC); sLeave += " /"; sLeave += " Has left as a player."; //Write a log entry of the info WriteTimestampedLogEntry(sLeave); //Send the info to all DMs online SendMessageToAllDMs(sLeave); //Tell ALL the Players who just left SendMessageToAllPC(GetName(oPC) + " Has left as a player."); /* ***DISABLED FOR ERROR REASONS*** //Let's make sure we can save thier location if(GetArea(GetAreaFromLocation(lSaved))!=OBJECT_INVALID) { SetCampaignLocation(GetName(GetModule()), "SAVED_LOC", lSaved, oPC); } */ //Main Script End } //PROTOTYPE DEFINED void SendMessageToAllPC(string sMessage) { object oPC = GetFirstPC(); while(GetIsObjectValid(oPC)) { FloatingTextStringOnCreature(sMessage, oPC); oPC = GetNextPC(); } }