1. I'm trying to spawn some wood (into a players invetory, or just around him so he can pick it up) but the problem is the prefab for resource/wood/wood.item doesnt work...

    Code:
    string name = "assets/prefabs/resource/wood/wood.prefab";
                    BaseEntity entity = GameManager.server.CreateEntity(name, pos);
                    entity.Spawn(true);
    Couldn't find prefab [path]
    [DOUBLEPOST=1457831309][/DOUBLEPOST]Ok, just another issue of mine: How do i remove an entity ? like a tree or an item on the ground.. ?
    [DOUBLEPOST=1457833250][/DOUBLEPOST]Figured out how to remove an entity: BaseEntity.Kill(); heh, quite simple :)
    But still need the first question solved :(
     
  2. To put items in a players inventory you must first create the item
    Code:
    void GiveItem(BasePlayer player, string shortname, int amount)
            {
                var definition = ItemManager.FindItemDefinition(shortname); //Find the item using its shortname
                if (definition != null)
                {
                    Item item = ItemManager.CreateByItemID(definition.itemid, amount); // Create the item
                    if (item != null)
                        player.inventory.GiveItem(item); // Place it in the players inventory
                }
            }
    To spawn piles of wood on the floor you must specify the correct prefab name, I am pretty sure the one you have listed is the item, not the entity itself? For this example I will just spawn it on the player position
    Code:
    void SpawnWood(BasePlayer player)
            {
                string name = "assets/bundled/prefabs/autospawn/collectable/stone/wood.prefab";           
                BaseEntity entity = GameManager.server.CreateEntity(name, player.transform.position);
                entity.Spawn(true);
            }
     
  3. I will look into it later today, thank you very much k1lly0u :)
     
  4. Use rustadmin it lets you give any item to the player right into their inventory