1. Hey guys.
    I am new in programming plugins so I want to build some easy Plugins for helping me to be better in programming.

    I 've 2 questions.
    First: I want to create a Plugin which give me on a command a Item to my inventory which I set in my code for example I write in code /giveitems = giveitem_ak
    Its a simple example ^^

    Second:
    Is there a oppurtunity to see all commands?
    I mean for example where I can see how the GiveItem function works or which functions exists in Oxide Rust.

    Thank you I hope you understand my problem ^^
     
  2. You can find Rust's data using a Decompiler like Telerik JustDecompile.
    Just decompile the Assembly-CSharp.dll file which can be found in the zip you get when downloading Oxide.
     
  3. Ok I decompiled it and founded for example a Script "PlayerInventory".
    Its hard for me to take from this Script the knowledge how to create or use the function to Additems :/

    I just created now:
    Code:
      public BasePlayer player;  [ChatCommand("item")]
      private void SaveCommand(BasePlayer player, string command, string[] args)
      {
      this.GiveItem(ItemManager.CreateByName("rock", 1);
      }
    
    I know I need the declaration of the function "GiveItem" but is it possible to import this or to use?
     
    Last edited by a moderator: Nov 2, 2015
  4. don't use "this." it is used there as it is inside the PlayerInventory class.
    You will need to use player.inventory to get that
     
  5. Code:
    player.inventory("rock, 1");
    Underline me inventory.

    Sry I am a noob ^^

    And how I know for example that the command is player.inventory and not giveItem how in the Assembly.dll?
    Would be nice if I would have a list for example To kill Player: player.kill() and more..
     
  6. player.inventory.GiveItem(ItemManager.CreateByName("rock"))
     
  7. Ok thank you it worked.
    How I can add for example silencer to a weapon?
    And is it possible to set the ak to my first inventory slot?

    I just found lua Scipting not for c#

    Code:
                    player.inventory.GiveItem(ItemManager.CreateByName("rifle.ak", 1));
     
    Last edited by a moderator: Nov 2, 2015
  8. Code:
    Item item = ItemManager.CreateByName("rifle.ak", 1);
    item.position = 1;
    item.contents.itemList.Add(ItemManager.CreateByName("weapon.mod.silencer", 1));player.inventory.GiveItem(item);