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)
Rust Item placement / Building Bypass
Discussion in 'Plugin Requests' started by [X] Meep, Jul 3, 2015.
-
No red placement marker ? i dont think that it is possible since it is a client sided.
-
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 -
You can put items in chest on the server side, as soon as it's spawned.
-
Okay... How.
-
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);
P.S. i hope more experienced devs could give more info on that -
Mind blown.
I don't know what all that shit means. I'm just a waitress at dennys. -
Could you shed some light on what you are trying to achieve?
-
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! lolLast edited by a moderator: Jul 4, 2015 -
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();
To add items use the code I posted earlier.