Verify that your OnClientLeave script is calling KDS1OnClientLeave and your OnClientEnter is calling KDS1OnClientEnter.
Modify your script to look like so:
[nwscript]
#include "_kds1_inc"
/*******************************************************************************
* lc_area_exit
*
* by LasCivious Sept 2004
* Called by area's OnExit event. Clears area encounters, dropped items,
* stores & cleans placeable inventories if no PC is present for a length of time.
*******************************************************************************/
// Set this to FALSE if you do not want placeable inventories cleared
int nClearPlaceInv = TRUE;
// Set the amount of time to wait for cleaning here in seconds
float fDelayTime = 300.0;
void CleanArea(object oArea)
{
//Check for PCs
object oPC = GetFirstPC();
while (GetIsObjectValid(oPC)) {
if (GetArea(oPC) == oArea) {
DeleteLocalInt(oArea, "CleanArea");
return;
}
oPC = GetNextPC();
}
object oTrash = GetFirstObjectInArea(oArea);
object oInvItem;
while(GetIsObjectValid(oTrash)) {
string sTagPrefix = GetStringLeft(GetTag(oTrash), 15);
// Clear remains, dropped items
if( (GetObjectType(oTrash)==OBJECT_TYPE_ITEM ||
GetStringLowerCase(GetName(oTrash)) == "remains") &&
(GetResRef( oTrash ) != DEAD_PC_ITEM_RESREF) ) {
AssignCommand(oTrash, SetIsDestroyable(TRUE));
if (GetHasInventory(oTrash)) {
oInvItem = GetFirstItemInInventory(oTrash);
while(GetIsObjectValid(oInvItem)) {
if( GetResRef( oInvItem ) != DEAD_PC_ITEM_RESREF) DestroyObject(oInvItem,0.0);
oInvItem = GetNextItemInInventory(oTrash);
}
}
else DestroyObject(oTrash, 0.0);
}
// Clear placeable inventories
if(GetObjectType(oTrash)==OBJECT_TYPE_PLACEABLE &&
nClearPlaceInv == TRUE) {
if (GetHasInventory(oTrash))
{
object oInvItem = GetFirstItemInInventory(oTrash);
while(GetIsObjectValid(oInvItem)) {
if( GetResRef( oInvItem ) != DEAD_PC_ITEM_RESREF) DestroyObject(oInvItem,0.0);
oInvItem = GetNextItemInInventory(oTrash);
}
}
}
// Clear encounters
else if (GetIsEncounterCreature(oTrash) ||
sTagPrefix == "PWFSE_SPAWNERID")
{
AssignCommand(oTrash, SetIsDestroyable(TRUE));
DestroyObject(oTrash, 0.0);
}
oTrash = GetNextObjectInArea(oArea);
}
DeleteLocalInt(oArea, "CleanArea");
}
void main()
{
object oArea = OBJECT_SELF;
object oPC = GetExitingObject();
if (!GetIsPC(oPC)) return;
if (GetLocalInt(oArea, "CleanArea") != 1)
{
DelayCommand(fDelayTime, CleanArea(oArea));
SetLocalInt(oArea, "CleanArea", 1);
}
}[/nwscript]
I'm not sure testing by yourself like that (where you must log out to get another character) will be sufficient to test this properly. You really need two actual players online during the entire test because the system does special things with the dead bodies when a player who dies logs out before leaving purg or when a player who is carrying a dead PC logs out before that dead PC returns from purg.
Modifié par Axe_Murderer, 30 septembre 2011 - 08:06 .