1. Hello,

    I've been testing to get the OwnerName from item_drop_backpack on function CanMoveItem(), item.GetOwner is null when moving items from item_drop_backpack to your own inventory, I cannot find the dead players name anyway.

    https://image.prntscr.com/image/I5rPbex5RCyK_Y2VkT1OXw.png

    Any hints or help?
     
  2. Had a quick look at the decompiled Assembly-CSharp.dll but I'm not able to test anything at this time but by the looks of it you should be able to get the name of the owner by doing something like this:
    Code:
    var ownerName = ((DroppedItemContainer)item.parent.entityOwner).playerName;
     
  3. I will take a look when I have time, thanks for your reply! :)
     
    Last edited by a moderator: Aug 12, 2017
  4. Yeah it works, but when the player is "switching" weapon from backpack it returns null value as Owner.

    I want to deny a player or players to be able to move items from their inventory to a backpack on the ground.

    You can't add more items to the backpack on the ground, but if you drag a weapon icon to another weapon in your inventory it will swap the item out.
     
  5. If you want to block items to be put into a backpack, have you tried using the CanAcceptItem hook? (Oxide API for Rust)
     
  6. CanMoveItem supplies the BasePlayer looter, if you want the owner of the dropped item container you can use “playerSteamId” or something along those lines.

    Then of course you’d find the BasePlayer with your preferred method. BasePlayer.FindById() etc.