Off the top of my head...could do a hearbeat script to keep track of how much time has passed. Came up with this:
//Heartbeat script
void main()
{
int iBeats = GetLocalInt(OBJECT_SELF, "BEATS");
SetLocalInt(OBJECT_SELF, "BEATS", iBeats + 1);
iBeats = GetLocalInt(OBJECT_SELF, "BEATS");
//@ approx 10 seconds per heartbeat, 360 HBs is approx 1 hour real time.
if (iBeats == 348)//2 minutes until inventory is deleted.
{
object oPC = GetFirstPC();
while (GetIsObjectValid(oPC))
{
SendMessageToPC(oPC, "The store inventory will be deleted in approx. two minutes.");
oPC = GetNextPC();
}
}
if (iBeats == 360)
{
object oStore = GetObjectByTag("Tag of your store");
object oItem = GetFirstItemInInventory(oStore);
while (GetIsObjectValid(oItem))
{
DestroyObject(oItem);
oItem = GetNextItemInInventory(oStore);
}
//Set beats back to 0 and start the proccess over again.
SetLocalInt(OBJECT_SELF, "BEATS", 0);
}
}
This destroys the inventory of the store after about 1 hour of real time. And gives a 2 minute warning to players before the inventory is deleted. You can playe around with the amount of beats if you want different timing.
You can add this to the HB of the module, the area the merchant is in, the merchant himself, or anything else with a heartbeat that can't be destroyed.
This is untested and there are other ways of doing this. This was just my first thought.
Good luck.
Modifié par GhostOfGod, 29 octobre 2010 - 08:31 .