#include "inc_pc_functions" #include "inc_system_const" #include "inc_mysql_tables" #include "rhs_include" void main() { object oPC = GetEnteringObject(); // Does not fire for non-PCs or DMs if(!GetIsPC(oPC) || GetIsDM(oPC)) return; object oArea = OBJECT_SELF; object oDatabase = GetItemPossessedBy(oPC, PC_DATABASE); string sLocation = APSLocationToString(GetLocation(oPC)); string sTag = GetTag(oArea); // Player rejoined the server after a restart - warp them to their last saved location if(sTag == "ooc_area") { AssignCommand(oPC, ActionJumpToLocation(APSStringToLocation(GetLocalString(oDatabase, "LOCATION_SYSTEM_SAVED_LOCATION")))); DelayCommand(10.0, SetLocalInt(oPC, "LOCATION_LOADED", TRUE)); } // Otherwise, simply update their location in their database item - only store location in non-house areas else if(!GetLocalInt(oArea, RHS_HOUSE_MARKER)) { SetLocalString(oDatabase, "LOCATION_SYSTEM_SAVED_LOCATION", sLocation); } }