Overview
This section explains how the banking system retrieves player cards from different inventory systems. You can adapt or extend these examples depending on which framework your server uses.ox_inventory
Retrieves all the card items (defined inConfig.item) from the player’s inventory, including their metadata.
-
GetPlayerItems()fetches all items the player currently holds. -
Each item is checked against
Config.item(e.g.,'visa'). - Matching items are inserted into the cards table.
-
Each card retains its metadata (e.g.,
cardId,accountIdentifier).
qb-inventory
Retrieves all player cards through a server callback, reformats the data, and returns a structured list of cards.-
The client requests card data from the server via
smzi_banking:getPlayerCards. -
Metadata (
card.info) is assigned to a consistentcard.metadatafield. - The data is formatted and resolved using a promise.
-
The function waits for completion using
Citizen.Await(p)before returning the result.
Notes
- The returned table from both functions is used to identify which accounts or cards a player currently holds.
- You can extend these functions to support custom inventories by following the same logic pattern.
-
Ensure that the inventory name in your
config.luamatches your server setup:
