Pivity

Inventory

Last read Never
#1

Help me create one sv and cl side for my gamemode please. or show me an example!

#2

depending on how you want it to work, but more or less just this for the base

  1. serverside database to store items, can structure it however such as:
  2. <steamid> | <inventory data as json> (not recommended)
  3. <steamid> | <item id> | <quantity> for every item
  4. when a player joins, fetch their inventory from the database, you can store it under ply.Inventory or wherever, then sync the data with the client
  5. when a change is made to the inventory, update the database & sync with the client

that's pretty much it tbh

#3
BullyHunter:
depending on how you want it to work, but more or less just this for the base
serverside database to store items, can structure it however such as:
<steamid> | <inventory data as json> (not recommended)
<steamid> | <item id> | <quantity> for every item
when a player joins, fetch their inventory from the database, you can store it under ply.Inventory or wherever, then sync the data with the client
when a change is made to the inventory, update the database & sync with the client
that's pretty much it tbh

Not really good at designing the clientside, I'll need that, thanks for that info.

Users viewing this thread
Nobody