1. Hi,

    First, Example:

    Im player and drop 10 of wood

    Second, Question:
    With hook OnEntitySpawned
    1-How i can get amount of droped entity
    2-How i can get creator owner of this entity (player)

    i search in google about entity and i dont know how do it

    Bye!!

    And sorry for basic english ;)
     
  2. entity.gameObject.ToBaseEntity().GetItem().amount
    With this you get amount, but i don know how to get creator owner
     
  3. thx, any know how i can get creator owner of entity
     
  4. Calytic

    Calytic Community Admin Community Mod

    You can use the EntityOwner API

    EntityOwner for Rust | Oxide

    Code:
    [PluginReference]
    Plugin EntityOwner;
    Code:
    ulong FindOwner(BaseEntity entity)
    {
        object returnhook = null;
        ulong ownerid = 0;
        returnhook = this.EntityOwner?.Call("FindEntityData", entity);    if (returnhook != null)
        {
            if (!(returnhook is bool))
            {
                ownerid = Convert.ToUInt64(returnhook);
            }
        }    return ownerid;
    }
     
  5. another option to get creator owner id ??
     
  6. Just use the Plugin he suggested that works Like a charm
     
  7. Calytic

    Calytic Community Admin Community Mod

    You cannot get the creator from OnEntitySpawned. Only OnEntityBuilt and OnItemDeployed can give you the player who placed the item. Look at EntityOwner for reference code if you want to do it yourself