Hello i am using this rest system and my issue is that I created an inn ((Set to unrestable in properties of area)) but I made my own trigger for allowing resting there and it doesnt work at all but everything compiles fine… Here is the rest system of module:
//::///////////////////////////////////////////////
//:: Resting Script
//:: boz_o1_resting
//:: Copyright © 2002 Brotherhood of Zock
//:://////////////////////////////////////////////
/*
This script allows the players to rest after a specified amount of hours
has passed and only (optional) if they are in possession of a “Bedroll” or use a local
“placeable” item that allows them to rest (and sets the LocalInt “iRestAllowed” to 1).
/
//:://////////////////////////////////////////////
//:: Created By: Kihon
//:: Created On: July 8, 2002
//:://////////////////////////////////////////////
// Counting the actual date from Year0 Month0 Day0 Hour0 in hours
int GetHourTimeZero()
{
int iHourTimeZero;
iHourTimeZero = (GetCalendarYear()-1)122824 + (GetCalendarMonth()-1)2824 + (GetCalendarDay()-1)*24 + GetTimeHour();
return iHourTimeZero;
}
// The main function placed in the onRest event
void main()
{
object oPlayer = GetLastPCRested();
int iRestDelay = 8; //The ammount of hours a player must wait between Rests
int iBedrollRequired = 1; // 0=No requirements for resting
// 1=A “Bedroll” is needed in order to rest.
// Optional may a “Rest-allowing-placable” be used,
// that sets the value of the local “iRestAllowed”
// variable on the player to “1”.
if (GetLastRestEventType() == REST_EVENTTYPE_REST_STARTED)
{
// Check if the Rest Dely is over.
if (GetHourTimeZero() < GetLocalInt (oPlayer, “iNextRestHourTimeZero”))
{
AssignCommand (oPlayer, ClearAllActions()); // Prevent Resting
SendMessageToPC (oPlayer, “You must wait " + IntToString (GetLocalInt (oPlayer, “iNextRestHourTimeZero”)-GetHourTimeZero()) + " hour(s) before resting again.”);
}
else // Resting possible.
{
// Resting allowed if No Bedroll required or Player has a Bedroll or a Rest-allowing-placeable set the local “iRestAllowed” variable to 1
if (iBedrollRequired == 0 || iBedrollRequired == 1 && (GetIsObjectValid (GetItemPossessedBy (oPlayer,“Bedroll”)) || GetLocalInt (oPlayer,“iRestAllowed”) == 1))
{
SetLocalInt (oPlayer, “iRestAllowed”, 0);
SetLocalInt (oPlayer, “iNextRestHourTimeZero”, GetHourTimeZero()+iRestDelay);
}
else // Resting not allowed
{
AssignCommand (oPlayer, ClearAllActions()); // Prevent Resting
SendMessageToPC (oPlayer, “No Bed(roll) - No Rest”);
}
}
}
}
Now here is my generic trigger that’s supposed to allow resting, same thing for exiting but changes the int to 0:
OnEnter:
void main()
{
object oPC = GetEnteringObject();
if(GetIsPC(oPC))
SetLocalInt(oPC, “iRestAllowed”, 1);
}
Onexit is same thing but 0 HELP PLEASE
I even tried for ONUSED of a bed item but it still did same error: Cannot rest in this area