Croll-Ammo - https://discord.gg/DBqCZjZ8VN
Server-authoritative ammo box unpacking for FiveM (Qbox, QB-Core, ESX, and custom adapters).
- Server-side reward catalog and validation.
- Supports
ox_inventoryexport flow and framework usable-item flow. - Atomic unpack mode with rollback protection.
- Configurable framework, inventory adapter, and notify provider.
- Input sanitization and defensive checks around item use.
fxmanifest.luaresource manifest.config.luaframework/inventory/notify options and locale text.server/amounts.luaserver-only ammo box catalog.server/opensource.luaframework + inventory adapter layer.server/main.luasecure unpack flow and rollback logic.install/ox_inventory_ammo_boxes.luaexample item definitions forox_inventory.
- FiveM server
- One of:
- Qbox (
qbx_core) - QB-Core (
qb-core) - ESX (
es_extended) - Custom framework/inventory implementation (edit
server/opensource.lua)
- Qbox (
Optional:
ox_inventory(recommended)ox_lib(whenConfig.Notification = 'ox')
- Place the resource folder in your server resources.
- Ensure this resource after your framework and inventory resources in
server.cfg. - Open
config.luaand set:Config.FrameworkConfig.InventoryConfig.Notification
- Configure your ammo box catalog in
server/amounts.lua. - Restart the resource.
When using ox_inventory, each ammo box item must call this server export:
server.export = 'Croll-Ammo.openBox'
Use install/ox_inventory_ammo_boxes.lua as a template and merge Config.BoxUnpackClient into each item's client data if you want progress/animation UX.
If ox_inventory is not running, the resource auto-registers usable items through your selected framework in server/opensource.lua.
For custom frameworks/inventories:
- Implement
AddItem,RemoveItem,CanCarryItem, andRegisterAmmoUseableItem. - Keep all reward logic in
server/amounts.luaandserver/main.lua
config.lua:
Config.Framework:qbox | qb-core | esx | customConfig.Inventory:ox | qb | codem | origen | tgiann | customConfig.Notification:ox | qb | esx | chat
server/amounts.lua:
- Defines every ammo box and reward amount server-side.
- Rejects invalid entries at load time (empty names, bad amounts, malformed tables).
- If you see missing item warnings for
ox_inventory, add those item names to yourox_inventoryitems data. - If boxes do nothing on use:
- verify
Config.FrameworkandConfig.Inventory - verify dependencies are started before this resource
- verify the item export/usable registration path matches your inventory mode
- verify
- If notifications do not appear, switch
Config.Notificationto a provider your server runs.
- Add/remove boxes in
server/amounts.lua. - Update labels/phrases by setting
notifyPhraseper box in the catalog. - For advanced custom behavior, edit only adapter functions in
server/opensource.luaand keep core unpack logic untouched.