Hey Ultra. So unfotunatly that doesnt work. I was reading the code and it makes no sense to me. When middle mouse dragging items out of your inventory it triggers the hooks in this order
OnItemAction
OnItemSplit
ItemDropped
So essentially it goes. Item action dropp. Item is split. half is returned and then call item dropped hook.
Reading the code it seems that way
:(
Merged postThis is the code in the playerInventory class where item action is called. Maybe your see what i mean
if (itemUid == null || Interface.CallHook("OnItemAction", (object) itemUid, (object) command, (object) msg.player) != null || (itemUid.IsLocked() || !this.CanMoveItemsFrom(itemUid.parent.entityOwner, itemUid)))
return;
if (command == "drop")
{
int split_Amount = itemUid.amount;
if (msg.read.Unread >= 4)
split_Amount = msg.read.Int32();
this.baseEntity.stats.Add("item_drop", 1, Stats.Steam | Stats.Life);
if (split_Amount < itemUid.amount)
itemUid.SplitItem(split_Amount)?.Drop(this.baseEntity.GetDropPosition(), this.baseEntity.GetDropVelocity(), new Quaternion());
else
itemUid.Drop(this.baseEntity.GetDropPosition(), this.baseEntity.GetDropVelocity(), new Quaternion());
this.baseEntity.SignalBroadcast(BaseEntity.Signal.Gesture, "drop_item", (Network.Connection) null);
}
else
{
itemUid.ServerCommand(command, this.baseEntity);
ItemManager.DoRemoves();
this.ServerUpdate(0.0f);
}