Inventories
config/server.lua exists for one case: an inventory that is neither ox_inventory nor
your framework’s own.
If you run either of those, this file needs nothing.
What the server side needs it for
Section titled “What the server side needs it for”| Call | Feeds |
|---|---|
GetCount |
Reserve ammo and consumable counts |
Remove |
The stress items configured in /hud → Admin |
OnUse (optional) |
Item use, when your inventory registers usable items itself |
Without OnUse, item use goes through your framework’s usable items instead.
Already recognised
Section titled “Already recognised”The first of these found running wins:
| Resource | Count | Remove | Usable items |
|---|---|---|---|
qs-inventory |
GetItemTotalAmount |
RemoveItem |
CreateUsableItem |
jaksam_inventory |
getTotalItemAmount |
removeItem |
registerUsableItem |
tgiann-inventory |
GetItemCount |
RemoveItem |
— |
ak47_inventory |
GetAmount |
RemoveItem |
— |
ak47_qb_inventory |
GetAmount |
RemoveItem |
— |
Adding another inventory that follows the same pattern is one line in that table — the resource name and the three export names.
Writing it out yourself
Section titled “Writing it out yourself”If your inventory does not fit the table, replace it with the adapter directly.
GetCount and Remove are required, OnUse is optional:
Custom.Inventory = { GetCount = function(src, itemName) return 0 end,
Remove = function(src, itemName, count) return true end,}Restart the resource after editing:
restart hud