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![]()
Getting entity information?
Discussion in 'Rust Development' started by dacoe, Dec 22, 2015.
-
entity.gameObject.ToBaseEntity().GetItem().amount
With this you get amount, but i don know how to get creator owner -
thx, any know how i can get creator owner of entity
-
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; }
-
another option to get creator owner id ??
-
Just use the Plugin he suggested that works Like a charm
-
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