AK47 QB Inventory
Kartik-Business integrates seamlessly with ak47_qb_inventory, allowing business items (food, ingredients, products, etc.) to be dynamically registered at runtime.
This custom QB inventory script has built-in support for Kartik-Business item registration, ensuring items are automatically added to the shared items table without additional modifications.
π¦ Requirements
Before proceeding, ensure the following dependencies are installed and running:
ak47_qb_inventory
qb-core
oxmysql
Kartik-Business
kartik-laptop
π How the Integration Works
When Kartik-Business needs to register a new item:
It triggers the server event handled by ak47_qb_inventory.
The item is appended to
ak47_qb_inventory/shared/items.luafor persistence.The internal
Config.Shared.Itemstable is updated for instant availability.If an image URL is provided, it is downloaded and saved to
ak47_qb_inventory/web/images/.
This process ensures that items created through the business system are recognized immediately.
π Server Event: Insert Item
Kartik-Business uses the following event to register items:
Item Data Format
π οΈ Built-in Integration
ak47_qb_inventory comes with pre-built support for Kartik-Business. The integration logic is already included in the script.
π Files Involved
ak47_qb_inventory/bridge/qb/server.lua- Contains the event handlerak47_qb_inventory/shared/items.lua- Where items are stored
π Implementation
The event handler is already present in bridge/qb/server.lua:
β οΈ Important Notes
Persistence: Items are written to the physical
shared/items.luafile.Instant Use: No server restart or resource restart is required.
Image Location: Images are saved automatically to:
Uniqueness: If an item with the same name already exists in
Config.Shared.Items, the insertion is skipped.
β
Integration Complete
With ak47_qb_inventory, Kartik-Business integration is ready out-of-the-box. New items created via the business app will be immediately available in the inventory and across the entire server.
Last updated