Hi All,
In my PvX mod that I am making I am now implementing a system for sharing items through specified containers.
I have a dictionary that has a players ulong as the key and the uint for the StorageContainers ID.
The issue im running into is that I have two calls in my mod:
ItemContainer.CanAcceptResult CanAcceptItem(ItemContainer container, Item item)
void OnItemRemovedFromContainer(ItemContainer container, Item item)
As you can see they are ItemContainer and I am unable to obtain StorageContainer IDs.
So I need help on finding a way to obtain StorageContainer IDs from ItemContainer, If this is not possible let me know as I will have to find another solution :-(.
Thanks all
Obtain StorageContainer from ItemContainer
Discussion in 'Rust Development' started by Alphawar, Jan 2, 2017.
-
Calytic Community Admin Community Mod
Maybe take a look at Bank for Rust | Oxide
What I do there is admittedly using StorageContainer as a pass-thru, but you could relatively easily wrap a system around that which would handle containers per-container (using netID) rather than per-player. -
-
Code:if (onlinePlayers.ContainsKey(player) && onlinePlayers[player].View != null) { if(onlinePlayers[player].View == inventory.entitySource) { CloseBank(player, (StorageContainer)inventory.entitySource); } }