Vending machine that use Economics (Rust)
vending open: add items to buy what is in there. Add playerID to a dictionary with a dictionary as the value and the playerID as the key. Add the items needed to buy the items in the vending machine to the dictionary so we can edit the player invo later.
on player increase/decrease buyable items, increase/decrease items in player inv to comp and increase/decrease items in the dictionary we made.
on player leaves/dies/disconnects: remove items from the players invo acording the the dictionary.
There you go. I will not add the coding to here as it is not mine but you can use plugins as examples and make your own. i used vending manager as my example to help with your question. here is a hook list of all the available hooks: https://docs.oxidemod.com/hooks/