Solved Skull ownership

Discussion in 'Rust Development' started by Xianith, Mar 17, 2017.

  1. I don't want to dig up old posts but now that item.ownership is out of the game is there a way to get the name of the skull and apply affects to certain peroples skuklls?

    Here is a code block from an old thread I found:


    Code:
     void OnItemAddedToContainer(ItemContainer container, Item item)
            {
                   var player = container.playerOwner;
                   if (!container.playerOwner) return;               if (item.info.shortname == "skull.human")
                   {
                             foreach (var owner in item.owners)
                            {
                                 SendReply(player, "You have the skull of "+owner.userid);
                            }
                   }
            }
    Old threads I didn't want to necropost into for reference:

    Solved - Items - Despawn Event?, Unique IDs?, Ownership? | Oxide
    Solved - Item.owners not longer available? | Oxide
     
  2. You would have to parse the name of the player from the name of the skull. When a human skull (skull.human) is looted the name of the item will be altered to `Skull of "player name"` so instead of looping through the owners of the item like you used you you now have grab the player's name from the name of the item (substring, regex,...) and then you should be able to use covalence to lookup that player's steamid.
     
  3. Thank's Mughisi! That's what I'm lookin for!