1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Oxide for Rust Legacy has been discontinued and is no longer supported. No updates or additions will be made, and Rust Legacy-specific plugin submissions will no longer be accepted. We recommend upgrading to the latest version of Rust as able.
    Dismiss Notice
  1. P0LENT4

    P0LENT4 Plugin Developer

    Hello, I would like to know if there is any form / code that identifies something in Furnace / Large Wood Storage and Wood Storage Box.

    I would like the code to look something like this:

    Code (Text):
    if (Iteminsidetheobject) {rust.SendChatMessage(netUser, "Remove everything within the object"); Return;}
    --- Double Post Merged, Dec 6, 2016 ---
    Because I want to make a small modification to the Removal Tool plugin
     
  2. P0LENT4

    P0LENT4 Plugin Developer

  3. Reneb

    Reneb Plugin Developer

    Code (Text):
    StorageContainer storage = entity.GetComponent<StorageContainer>();
    if(storage != null)
    {
    DropUtil.DropItems(storage.inventory,entity.transform.position, 1f);
    }
     
  4. P0LENT4

    P0LENT4 Plugin Developer

    @Reneb
    The errors are showing up ..

    Code (Text):
    [Oxide] 10:13 [Error] Error while compiling RemoverTool.cs(149,11): error CS0103: The name `DropUtil' does not exist in the current context
    If you leave the code like this:
    Code (Text):
    StorageContainer storage = entity.GetComponent<StorageContainer>();
    if(storage != null)
    {
    }
    This error appears
    Code (Text):
    [Oxide] 10:13 [Error] Error while compiling RemoverTool.cs(147,13): error CS0841: A local variable `storage' cannot be used before it is declared