PWE_PRC8/_module/nss/av_persist.nss
Jaysyn904 ee1dc35889 Initial Commit
Initial Commit
2025-04-03 10:29:41 -04:00

48 lines
1.1 KiB
Plaintext

void LodPlayer(object oPC) {
string avalon = GetModuleName();
string playnam = GetPCPlayerName(oPC);
location playloc = GetLocation(oPC);
DelayCommand(IntToFloat(6), AssignCommand(oPC, ActionJumpToLocation(GetCampaignLocation(avalon, playnam, oPC))));
SendMessageToPC(oPC, "Player data loaded");
}
void SavPlayer(object oPC) {
string avalon = GetModuleName();
string playnam = GetPCPlayerName(oPC);
location playloc = GetLocation(oPC);
SetCampaignLocation(avalon, playnam, playloc, oPC);
SendMessageToPC(oPC, "Player location saved");
}
void SavAllPlayers() {
// First we set up the object oPlayer
object oPC = OBJECT_INVALID;
// Get the first PC in the game to loop through.
oPC = GetFirstPC();
while (oPC != OBJECT_INVALID) {
PrintString("Saving all players: Found valid player");
// Make sure the PC is in a valid area if not don't save location.
if (GetIsObjectValid(GetArea(oPC)) == TRUE) {
SendMessageToPC(oPC, "Player data saved");
SavPlayer(oPC);
}
// Get the next Player for the while loop
oPC = GetNextPC();
}
}