hey guys
i've tried to make a plugin that hurts players after they looted a chest not fully.
no idea how i detect "closing storage"
i tried something like this:
but i dont find a way how to detect when he closing/leaving the container, so it will hurt him anytime he picks a item...
thanks!
i've tried to make a plugin that hurts players after they looted a chest not fully.
no idea how i detect "closing storage"
i tried something like this:
void OnItemRemovedFromContainer(ItemContainer container, Item item, BasePlayer player) {
if ((container == null) || (item == null) || (player == null)) return;
int _containerCount = container.itemList.Count;
if (container.itemList.Count != 0) {
// this will always count
}
}
void OnLootEntity(BasePlayer player, BaseEntity entity) {
if (entity == null || player == null) return;
LootContainer container = entity as LootContainer;
int count = 0;
if (container) {
foreach (var item in container.inventory.itemList) {
count++;
}
}
lootcontroll.Add(new LootControl((int)player.userID, count));
}but i dont find a way how to detect when he closing/leaving the container, so it will hurt him anytime he picks a item...
thanks!