1. Is there any way to detect if a player is right clicking on an item to move it to their inventory? I saw an old thread saying it was strictly client side but I just wanted to check again to see if it has changed since then.
    The event I've been using to check is CanMoveItem but I don't really know where to start.
     
  2. Wulf

    Wulf Community Admin

    Pretty sure that is only client-side.
     
  3. I'm gonna keep looking but OK :(
     
  4. I figured out a way to detect it! The targetSlot always ends up as -1 when I move an item into my inventory with right click. Now the problem is when I try to detect what the target container is it always ends up as null? You can test the code out for yourself.
    Code:
            private object CanMoveItem(Item item, PlayerInventory playerLoot, uint targetContainer, int targetSlot)
            {
                Puts("" + targetSlot);
                if(targetSlot == -1) {
                    var container = playerLoot.FindContainer(targetContainer);
                    if(container == null) { Puts("Container is null!"); }
                    var sourcecontainer = item.GetRootContainer();
                    var e = ItemManager.CreateByItemID(item.info.itemid, item.amount);
                    e.MoveToContainer(sourcecontainer, -1); //NEED TO MOVE TO PLAYER INVENTORY
                    return true;
                }
                return null;
            }