OrigenNetwork
Docs

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.

text
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 bridge

custom/client.lua

ShowHelpNotification(key, msg)

Show an interaction hint text. Dispatches to Config.Framework.

lua
function ShowHelpNotification(key, msg)
    -- 'qbcore' → exports['qb-core']:DrawText(msg, nil, key)
    -- 'esx'    → Framework.ShowHelpNotification(msg, key)
end

HideHelpNotification()

Hide the interaction hint text.

lua
function HideHelpNotification()
    -- 'qbcore' → exports["qb-core"]:HideText()
    -- custom: implement here
end

GetPlayerItems(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.

lua
function GetPlayerItems(PlayerData)
    -- Config.Inventory == 'custom': implement here
    return PlayerData.items or {}
end

GetItemFromWeapon(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:

  • qbcoreexports["qb-menu"]:openMenu(...)
  • esxFramework.UI.Menu.Open(...)

custom/server.lua

SetItemMetadata(source, item, slot, info)

Set metadata on an inventory item after purchase. Only implemented for origen_inventory.

lua
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
end

SelectPlate(plate)string | nil

Check if a plate already exists in the vehicle table. Dispatches based on Config.Framework.

lua
function SelectPlate(plate)
    -- 'qbcore' → SELECT plate FROM player_vehicles
    -- 'esx'    → SELECT plate FROM owned_vehicles
end

AddVehicle(vehName, license, identifier, model, hash, plate, garage, state)

Insert a new vehicle into the framework's vehicle table after purchase.

lua
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
end

doPayment(type, price, cryptoPrice, pID, cb)

Handle the payment for a purchase. Checks the player's balance and deducts the amount.

ParameterTypeDescription
typestring'money' | 'crypto'
pricenumberCash price
cryptoPricenumberCrypto price
pIDnumberPlayer server ID
cbfunctionCalled with true on success, false on insufficient funds

When Config.MoneyItems.enabled = true, checks inventory item count. When false, checks framework account balance.