Custom · origen_blackmarket
The custom/ folder handles framework integration, inventory access and UI without touching the core. All files are escrow_ignore — they survive updates.
custom/
├── client.lua — notifications, inventory access, menu, weapon lookup
├── server.lua — payment, vehicle insertion, item metadata, plate check
└── framework/
├── client/
│ ├── qb.lua — QBCore client bridge
│ └── esx.lua — ESX client bridge
└── server/
├── qb.lua — QBCore server bridge
└── esx.lua — ESX server bridgecustom/client.lua
ShowHelpNotification(key, msg)
Show an interaction hint text. Dispatches to Config.Framework.
function ShowHelpNotification(key, msg)
-- 'qbcore' → exports['qb-core']:DrawText(msg, nil, key)
-- 'esx' → Framework.ShowHelpNotification(msg, key)
endHideHelpNotification()
Hide the interaction hint text.
function HideHelpNotification()
-- 'qbcore' → exports["qb-core"]:HideText()
-- custom: implement here
endGetPlayerItems(PlayerData) → table
Returns the local player's inventory items. Dispatches to Config.Inventory.
Supported: qs-inventory, ls-inventory, origen_inventory, ox_inventory, codem-inventory, core_inventory. Falls back to PlayerData.items for qb-inventory.
function GetPlayerItems(PlayerData)
-- Config.Inventory == 'custom': implement here
return PlayerData.items or {}
endGetItemFromWeapon(PlayerData, weapon) → item | nil
Returns the inventory item matching a given weapon hash. Used to check if a player owns a specific weapon before applying a camo.
OpenMenu(...)
Opens the context menu for purchasing camos. Dispatches to Config.Framework:
qbcore→exports["qb-menu"]:openMenu(...)esx→Framework.UI.Menu.Open(...)
custom/server.lua
SetItemMetadata(source, item, slot, info)
Set metadata on an inventory item after purchase. Only implemented for origen_inventory.
function SetItemMetadata(source, item, slot, info)
if Config.Inventory == "origen_inventory" then
exports.origen_inventory:SetItemMetadata(source, item, slot, info)
else
-- Add your inventory metadata implementation here
end
endSelectPlate(plate) → string | nil
Check if a plate already exists in the vehicle table. Dispatches based on Config.Framework.
function SelectPlate(plate)
-- 'qbcore' → SELECT plate FROM player_vehicles
-- 'esx' → SELECT plate FROM owned_vehicles
endAddVehicle(vehName, license, identifier, model, hash, plate, garage, state)
Insert a new vehicle into the framework's vehicle table after purchase.
function AddVehicle(vehName, license, identifier, model, hash, plate, garage, state)
-- 'qbcore' → INSERT INTO player_vehicles (license, citizenid, vehicle, hash, mods, plate, garage, state)
-- 'esx' → INSERT INTO owned_vehicles (owner, plate, vehicle, type, stored, garage)
-- Uses Config.DefaultCarProperties for the vehicle JSON blob
enddoPayment(type, price, cryptoPrice, pID, cb)
Handle the payment for a purchase. Checks the player's balance and deducts the amount.
| Parameter | Type | Description |
|---|---|---|
type | string | 'money' | 'crypto' |
price | number | Cash price |
cryptoPrice | number | Crypto price |
pID | number | Player server ID |
cb | function | Called with true on success, false on insufficient funds |
When Config.MoneyItems.enabled = true, checks inventory item count. When false, checks framework account balance.