Inventories
Each participant’s inventory is stored in the database when the night starts and returned at the end.
Config.Inventario | For | How it stores |
|---|---|---|
"vrp" | vRP (including the vRPex variant, detected on its own) | getInventory / tryGetInventoryItem / giveInventoryItem, with slot and expiry |
"ox" | ESX, QBCore or QBox with ox_inventory | GetInventoryItems / RemoveItem / AddItem, with slot and metadata (serial, durability, ammo) |
"qb" | qb-inventory, ps-inventory, lj-inventory | PlayerData.items / RemoveItem / AddItem, with slot and info |
"esx" | ESX without ox_inventory | items with removeInventoryItem/addInventoryItem and loadout weapons (ammo, attachments and tint) |
How it stores
- Reads the inventory.
- Writes the copy.
- Checks the copy.
- Writes each item to
gui_noite_itens_guardados. - Only then removes it from the inventory.
Each item is returned only once. If something fails halfway, it continues from where it stopped.
On ESX, QBCore and QBox the inventory only changes with the player online. If they are offline at the end, everything stays stored and returns when they join.
Default kit and loot
Each inventory has a default kit and loot ready in Gui.Padroes:
| Inventory | Default |
|---|---|
| ox | WEAPON_PISTOL + ammo-9 |
| qb | weapon_pistol + pistol_ammo |
| esx | the weapon with Config.municaoArmaESX ammo |
The names must exist in your inventory. The panel warns on the item card when one does not exist (“not found on the server”).
Another inventory
- In
functions.lua, copy one of theInv.ox,Inv.qborInv.esxblocks. - Give it a name, for example
Inv.myinv. - Replace the calls with your inventory’s.
- Set
Config.Inventario = "myinv".
Each block has the same small functions:
| Function | What it does |
|---|---|
Ler | lists what is in the inventory |
Tirar | removes one line |
Devolver | returns with slot and metadata |
DarNovo | gives kit, airdrop and prize items |
Quantidade | amount of an item |
Limpar | empties the inventory before returning the original |
Valido | the item exists in the inventory |
Nome | item name for the screen |
Lista | items listed in the panel |
Municao | ammo from the ammo base |
DepoisDeMexer | tells the inventory it was changed (put away the weapon in hand, clear ammo) |
PastaImagens | folder with item pictures for the panel |