1. 2 Requests

    Any way to have the server add items to a wooden chest ?

    Anyway to bypass the building requirements. I want only admin to be able to place something anyway they want. (No Red Placement Marker)
     
  2. No red placement marker ? i dont think that it is possible since it is a client sided.
     
  3. Doesnt it have to check the server to see if its okay?
    [DOUBLEPOST=1435910294,1435901069][/DOUBLEPOST]Command to place items in a wood box is more important to me
     
  4. You can put items in chest on the server side, as soon as it's spawned.
     
  5. Okay... How.
     
  6. for example you can use following hooks:
    http://docs.oxidemod.org/rust/?csharp#onentityspawned
    http://docs.oxidemod.org/rust/?csharp#onplayerloot

    Point is - you need to get BaseEntity with LootContainer attached. Looks at rust code in CSharp-Assembly to get a peek of what could be useful.

    Then try following code:
    Code:
    var itemList = entity.GetComponent<LootContainer>().inventory;
    var myItem = ItemManager.CreateByName("spear_stone");
    myItem.MoveToContainer(itemList);
    HTH

    P.S. i hope more experienced devs could give more info on that
     
  7. Mind blown.


    I don't know what all that shit means. I'm just a waitress at dennys.
     
  8. Could you shed some light on what you are trying to achieve?
     
  9. I'd like a box that exists in a house to be filled with loot randomly every hour.

    Selectable loot though. I dont want to see quarry in it every time! lol
     
    Last edited by a moderator: Jul 4, 2015
  10. That is totally possible. But I'm not aware of existing plugins that are able to do this.
    You may check the code of http://oxidemod.org/plugins/boxlooters.989/

    You just need to get the box, store its id in a config and start a timer which will add items to this box each specified interval. Though, IDK how to get an item by its id. There surely must be an API for that.

    To get all items in game use
    Code:
    var itemDefs = ItemManager.GetItemDefinitions();
    then you may filter items using rarity, shortname properties etc. and just add then using their shortname to a container.
    To add items use the code I posted earlier.