1. 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
     
  2. Calytic

    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.
     
  3. Thank you for that
     
  4. Hi Calytic, What would be able to explain abit about this please:
    Code:
                if (onlinePlayers.ContainsKey(player) && onlinePlayers[player].View != null)
                {
                    if(onlinePlayers[player].View == inventory.entitySource) {
                        CloseBank(player, (StorageContainer)inventory.entitySource);
                    }
                }
    If you want to join my Discord or add me on Steam feel free to do so :)