Aller au contenu

Photo

OnDisturbed help


  • Veuillez vous connecter pour répondre
1 réponse à ce sujet

#1
doomie22

doomie22
  • Members
  • 9 messages
Hi,

I am trying to create a max limit on items in a chest.

I am trying to set it up using the OnDisturbed section.  Is there a way of checking if an item is being put in so I can add or take away a stored int?

If not, anyone know of another way?

Thanks,

 

#2
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
// Get the type of disturbance (INVENTORY_DISTURB_*) that caused the caller's
// OnInventoryDisturbed script to fire.  This will only work for creatures and
// placeables.
int GetInventoryDisturbType()

Uses these consts:

INVENTORY_DISTURB_TYPE_ADDED
INVENTORY_DISTURB_TYPE_REMOVED
INVENTORY_DISTURB_TYPE_STOLEN

So,
if (GetInventoryDisturbType() == INVENTORY_DISTURB_TYPE_ADDED)

is what you want.

Funky