Integrations
Core Business is designed to turn any property into a functional node for other scripts. Using the Closest Property API, external scripts can check stock, remove items, add items, register sales, and register expenses — all tied to the nearest business-owned property.
RAIDScore_gangs
DISPATCHcore_dispatch
INVENTORYcore_inventory
VEHICLE CUSTOMIZATIONcore_mechanic
GAS STATION PROPERTIESqb-fuel / ox_fuel
CLOTHING SHOP PROPERTIESillenium / qb-clothing
ATM PROPERTIESqb-banking / esx
How It Works
Every integration follows the same pattern:
- An external script (fuel, clothing, banking, etc.) fires on its normal event
- It calls Core Business exports with the player's coordinates
- Core Business finds the closest property and performs the operation
- The business that owns the property gets the income/expense logged in their transactions
This means any property location can become a fuel pump, clothing store, ATM, or anything else — without modifying Core Business itself.
Available Integration Scripts
We provide pre-built integration patches for popular scripts. These are lightweight wrappers that connect the external script to Core Business exports.
Coming Soon
Download links will be added as integration scripts are released. Check back for updates.
| Script | Type | Description | Download |
|---|---|---|---|
| qb-fuel | Fuel | Gas station properties sell fuel from their stash | Coming soon |
| ox_fuel | Fuel | Gas station properties sell fuel from their stash | Coming soon |
| LegacyFuel | Fuel | Gas station properties sell fuel from their stash | Coming soon |
| illenium-appearance | Clothing | Clothing store sales register as property income | Coming soon |
| qb-clothing | Clothing | Clothing store sales register as property income | Coming soon |
| qb-banking | Banking | ATM fees register as property income | Coming soon |
| esx_banking | Banking | ATM fees register as property income | Coming soon |
Building Your Own Integration
Any script can integrate with Core Business using the server-side exports. Here are the exports you need:
Get Item Stock
server
exports['core_business']:closestPropertyItemCount(coords, itemName)Returns the total count of an item across all storages of the closest property. Returns 1000.0 if no property is found (safe fallback so stock checks always pass when no property exists).
| Parameter | Type | Description |
|---|---|---|
coords | vector3 | World coordinates to find the closest property |
itemName | string | Item name to check |
Returns:
numberExample
lua
local stock = exports['core_business']:closestPropertyItemCount(coords, 'fuel')Remove Item
server
exports['core_business']:closestPropertyRemoveItem(coords, itemName, amount)Removes an item from the closest property storage. Returns true if successful or if no property was found.
| Parameter | Type | Description |
|---|---|---|
coords | vector3 | World coordinates to find the closest property |
itemName | string | Item name to remove |
amount | number | Amount to remove |
Returns:
booleanExample
lua
exports['core_business']:closestPropertyRemoveItem(coords, 'fuel', 10)Add Item
server
exports['core_business']:closestPropertyAddItem(coords, itemName, amount)Adds an item to the closest property storage.
| Parameter | Type | Description |
|---|---|---|
coords | vector3 | World coordinates to find the closest property |
itemName | string | Item name to add |
amount | number | Amount to add |
Returns:
booleanExample
lua
exports['core_business']:closestPropertyAddItem(coords, 'repairkit', 5)Register a Sale (Income)
server
exports['core_business']:closestPropertyRegisterSale(coords, money, description)Adds income to the business that owns the closest property. The money is added to the business balance, logged as a transaction, and tracked in financial statistics.
| Parameter | Type | Description |
|---|---|---|
coords | vector3 | World coordinates to find the closest property |
money | number | Amount of money to register |
description | string | Transaction description for the business log |
Returns:
booleanExample
lua
exports['core_business']:closestPropertyRegisterSale(coords, 500, 'Fuel sale: 25L @ $20/L')Register an Expense
server
exports['core_business']:closestPropertyRegisterExpense(coords, money, description)Deducts money from the business that owns the closest property.
| Parameter | Type | Description |
|---|---|---|
coords | vector3 | World coordinates to find the closest property |
money | number | Amount of money to deduct |
description | string | Transaction description for the business log |
Returns:
booleanExample
lua
exports['core_business']:closestPropertyRegisterExpense(coords, 200, 'Fuel restock delivery')Get Item Price
server
exports['core_business']:closestPropertyGetPrice(coords, itemName, mode)Returns the market listing price for an item. Falls back to default market prices for unowned properties. Returns nil if no listing exists.
| Parameter | Type | Description |
|---|---|---|
coords | vector3 | World coordinates to find the closest property |
itemName | string | Item name to check price for |
mode | string | sell (property sells to player) or buy (property buys from player) |
Returns:
number|nilExample
lua
local price = exports['core_business']:closestPropertyGetPrice(coords, 'fuel', 'sell')Integration Examples
Fuel Station
Turn gas station properties into functional fuel pumps. When a player refuels, check stock, remove fuel, and register the sale:
lua
-- server-side fuel handler
local coords = GetEntityCoords(GetPlayerPed(source))
-- Check if this station has fuel
local stock = exports['core_business']:closestPropertyItemCount(coords, 'fuel')
if stock < fuelAmount then
-- Station is out of fuel
TriggerClientEvent('notify', source, 'This station is out of fuel')
return
end
-- Get the price set by the property owner
local pricePerUnit = exports['core_business']:closestPropertyGetPrice(coords, 'fuel', 'sell')
if not pricePerUnit then pricePerUnit = 20 end -- fallback
local totalCost = pricePerUnit * fuelAmount
-- Remove fuel from property storage
exports['core_business']:closestPropertyRemoveItem(coords, 'fuel', fuelAmount)
-- Register the income to the business
exports['core_business']:closestPropertyRegisterSale(
coords, totalCost, 'Fuel sale: ' .. fuelAmount .. 'L @ $' .. pricePerUnit .. '/L'
)Clothing Store
Register outfit purchases as income for the property owner:
lua
-- server-side clothing purchase handler
local coords = GetEntityCoords(GetPlayerPed(source))
-- Register the sale
exports['core_business']:closestPropertyRegisterSale(
coords, outfitPrice, 'Clothing purchase: ' .. outfitName
)ATM Fees
Charge a transaction fee on ATM withdrawals, paid to the property owner:
lua
-- server-side ATM withdrawal handler
local coords = GetEntityCoords(GetPlayerPed(source))
local fee = math.floor(amount * 0.02) -- 2% fee
if fee > 0 then
exports['core_business']:closestPropertyRegisterSale(
coords, fee, 'ATM fee: 2% on $' .. amount
)
endCustom Shop (Any Script)
Any script that sells items at a location can check property stock and register sales:
lua
-- server-side shop purchase handler
local coords = GetEntityCoords(GetPlayerPed(source))
local item = 'repairkit'
local amount = 1
-- Check stock
local stock = exports['core_business']:closestPropertyItemCount(coords, item)
if stock < amount then
TriggerClientEvent('notify', source, 'Out of stock')
return
end
-- Get property owner's price
local price = exports['core_business']:closestPropertyGetPrice(coords, item, 'sell')
if not price then
TriggerClientEvent('notify', source, 'Item not for sale here')
return
end
-- Process the sale
exports['core_business']:closestPropertyRemoveItem(coords, item, amount)
exports['core_business']:closestPropertyRegisterSale(coords, price, 'Sold ' .. item .. ' x' .. amount)
-- Give item to player
-- (your framework's add item logic here)Full Exports Reference
For the complete list of all client and server exports (data access, business management, and closest-property API), see the Exports & API page.
