1. Hey, I'm learning how to use oxide and I started yesterday but I'm having trouble finding a function.
    First I took a look at Assembly-CSharp.dll and opened the ItemManager class. What I was looking for was a function called
    Code:
    ItemManager.CreateByItemID(definition.itemid, giveamount);
    I found this snippet of code from GUIShop. It wasn't there for me, so I kept looking but I couldn't turn up with anything. Where is this function? I know the answer is probably simple but if someone could just push me in the right direction that would be amazing. I also know this code work because I tried it out in game and gave items to my player.

    P.S sorry for grammar errors I'm really tired
     
  2. Code:
    public static Item CreateByItemID(int itemID, int iAmount = 1, ulong skin = 0L)
        {
            ItemDefinition itemDefinition = ItemManager.FindItemDefinition(itemID);
            if (itemDefinition == null)
            {
                return null;
            }
            return ItemManager.Create(itemDefinition, iAmount, skin);
        }
    
    Is this what you wanted? :)
    Just go under <default namespace> and then down to ItemManager
     
  3. Yah that's exactly what I wanted! I don't know why but it's not showing up? I also just found it out that I can't see the function GiveItem() in the PlayerInventory class. Let me show you what the ItemManager class looks like for me.
    Code:
    using ProtoBuf;
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Linq;
    using UnityEngine;public class ItemManager
    {
        public static List<ItemDefinition> itemList;    public static Dictionary<int, ItemDefinition> itemDictionary;    public static List<ItemBlueprint> bpList;    public static int[] defaultBlueprints;    public static void Initialize()
        {
            if (ItemManager.itemList != null)
            {
                return;
            }
            Stopwatch stopwatch = new Stopwatch();
            stopwatch.Start();
            IEnumerable<GameObject> source = FileSystem.Load<ObjectList>("Assets/items.asset", true).objects.Cast<GameObject>();
            if (stopwatch.Elapsed.TotalSeconds > 1.0)
            {
                UnityEngine.Debug.Log("Loading Items Took: " + (stopwatch.Elapsed.TotalMilliseconds / 1000.0).ToString() + " seconds");
            }
            List<ItemDefinition> list = (from x in source
            select x.GetComponent<ItemDefinition>() into x
            where x != null
            select x).ToList<ItemDefinition>();
            List<ItemBlueprint> list2 = (from x in source
            select x.GetComponent<ItemBlueprint>() into x
            where x != null && x.userCraftable
            select x).ToList<ItemBlueprint>();
            Dictionary<int, ItemDefinition> dictionary = new Dictionary<int, ItemDefinition>();
            foreach (ItemDefinition current in list)
            {
                current.Initialize(list);
                if (dictionary.ContainsKey(current.itemid))
                {
                    ItemDefinition itemDefinition = dictionary[current.itemid];
                    UnityEngine.Debug.LogWarning(string.Concat(new object[]
                    {
                        "Item ID duplicate ",
                        current.itemid,
                        " (",
                        current.name,
                        ") - have you given your items unique shortnames?"
                    }), current.gameObject);
                    UnityEngine.Debug.LogWarning("Other item is " + itemDefinition.name, itemDefinition);
                }
                else
                {
                    dictionary.Add(current.itemid, current);
                }
            }
            stopwatch.Stop();
            if (stopwatch.Elapsed.TotalSeconds > 1.0)
            {
                UnityEngine.Debug.Log(string.Concat(new string[]
                {
                    "Building Items Took: ",
                    (stopwatch.Elapsed.TotalMilliseconds / 1000.0).ToString(),
                    " seconds / Items: ",
                    list.Count.ToString(),
                    " / Blueprints: ",
                    list2.Count.ToString()
                }));
            }
            ItemManager.defaultBlueprints = (from x in list2
            where !x.NeedsSteamItem
            select x.targetItem.itemid).ToArray<int>();
            ItemManager.itemList = list;
            ItemManager.bpList = list2;
            ItemManager.itemDictionary = dictionary;
        }    public static void UpdateUnlockedSkins()
        {
            ItemManager.Initialize();
        }    public static global::Item Load(ProtoBuf.Item load, global::Item created, bool isServer)
        {
            if (created == null)
            {
                created = new global::Item();
            }
            created.isServer = isServer;
            created.Load(load);
            if (created.info == null)
            {
                UnityEngine.Debug.LogWarning("Item loading failed - item is invalid");
                return null;
            }
            return created;
        }    public static ItemDefinition FindItemDefinition(int itemID)
        {
            ItemDefinition result = null;
            ItemManager.itemDictionary.TryGetValue(itemID, out result);
            return result;
        }    public static ItemDefinition FindItemDefinition(string shortName)
        {
            ItemManager.Initialize();
            for (int i = 0; i < ItemManager.itemList.Count; i++)
            {
                if (ItemManager.itemList[i].shortname == shortName)
                {
                    return ItemManager.itemList[i];
                }
            }
            return null;
        }    public static ItemBlueprint FindBlueprint(ItemDefinition item)
        {
            return item.GetComponent<ItemBlueprint>();
        }    public static List<ItemDefinition> GetItemDefinitions()
        {
            ItemManager.Initialize();
            return ItemManager.itemList;
        }    public static List<ItemBlueprint> GetBlueprints()
        {
            ItemManager.Initialize();
            return ItemManager.bpList;
        }
    }
    
     
  4. Are you looking in the Assembly-CSharp.dll that is found in: RustDedicated_Data\Managed ?
     
  5. All I have in C:\Program Files (x86)\Steam\steamapps\common\Rust is RustClient_Data
    Where is RustDedicated_Data???

    Edit: Gyazo - 89516d6ac770438210bda4883c46a23c.png
     
  6. You need to decompile the server files, not the client files. You cannot make plugins to effect the client, only the server.
     
  7. I have been looking at the wrong thing for 2 days now!? How am I creating things!
    Thank you