OrigenNetwork
Docs

Custom · origen_masterjob

The custom/ folder handles framework integration, inventory, clothing, vehicles, fuel and notifications without touching the core. All files are escrow_ignore — they survive updates.

text
custom/
├── client.lua              — notifications, inventory, stash, clothing, garage, mechanic, keys, fuel
├── client_pay_bills.lua    — bill payment NPC thread
├── blips.lua               — business blip rendering
└── server/
    ├── command.lua         — admin command definitions
    ├── main.lua            — inventory helpers, vehicle queries, payment, keys, bill sending
    └── menu/
        └── phone.lua       — phone number lookup

custom/client.lua

Custom.canOpenMenu(job){ success, message }

Gate whether the local player can open the business menu. Return success = false with a message to block access.

lua
Custom.canOpenMenu = function(job)
    return { success = true, message = '' }
end

Custom.ShowNotification(msg)

Show a notification to the local player. Used when Config.CustomNotify = true.

lua
Custom.ShowNotification = function(msg)
    -- Add your notification here
    -- Example: exports["origen_notify"]:ShowNotification(msg, "business")
end

Custom.ShowShopState(msg)

Show a shop-related notification (e.g. purchase success/failure).

lua
Custom.ShowShopState = function(msg)
    -- Same as ShowNotification but can use a different style
end

ShowHelpNotification(key, msg)

Show an interaction hint in the world. Used when Config.OrigenNotify = true.

lua
function ShowHelpNotification(key, msg)
    -- Default: uses origen_notify CreateHelp
    -- Add your own implementation if not using origen_notify
end

Custom.DrawText(key, msg) / Custom.HideText()

Draw text UI interaction hint. Used when Config.customDrawText = true.


GetItemData(item)table | nil

Returns item data from the active inventory system. Dispatches to Config.Inventory.


OpenStash(Sid, Sslots, label, preId)

Opens a stash inventory. Dispatches to Config.Inventory:

  • ox_inventoryopenInventory('stash', ...)
  • codem-inventoryOpenStash(...)
  • Others → QBCore stash server event

OpenOutfitMenu(canEdit)

Opens the outfit selection menu. Dispatches to Config.Clothing.


openPlayerInventory(pID)

Open another player's inventory (for mechanic job). Dispatches to Config.Inventory.


Custom.ReapirVehicle(vehicle)

Repair a vehicle. Implement your deformation fix here if needed.

lua
Custom.ReapirVehicle = function(vehicle)
    -- exports['VehicleDeformation']:FixVehicleDeformation(vehicle)
end

Custom.GetVehicleProperties(vehicle) / Custom.SetVehicleProperties(vehicle, mods)

Get/set vehicle mods. Dispatches to Config.Framework.


Custom.GetVehicleFuel(vehicle) / Custom.SetVehicleFuel(vehicle, fuel)

Get/set vehicle fuel. Implement your fuel system here.

lua
Custom.GetVehicleFuel = function(vehicle)
    -- return exports['FuelSystem']:GetFuel(vehicle)
end

Custom.OpenModificationMenu(vehicle)

Open the tuning menu. Implement your tuning system here.

lua
Custom.OpenModificationMenu = function(vehicle)
    -- Used when Config.CustomMechanic = true
end

Custom.GetClientVehicleKeys(vehicle)

Give the player keys for a vehicle client-side. Implement your key system here.

lua
Custom.GetClientVehicleKeys = function(vehicle)
    local plate = GetVehicleNumberPlateText(vehicle)
    TriggerEvent("vehiclekeys:client:SetOwner", plate)
end

Custom.SpawnVehicle(model, cb, coords, isNetwork)

Spawn a vehicle. Dispatches to Config.Framework.


CustomGarage(PlayerData, coords) / CustomGarageBusiness(PlayerData, coords)

Override the default garage with your own system. Only called when Config.CustomGarage = true.


custom/server/main.lua

Custom.RemoveMoney(Player, account, amount, log)boolean

Remove money from a player's account. Handles ox_inventory item cash and framework accounts.


Custom.GetVehicleKeys(source, plate)

Give vehicle keys server-side. Implement your key system here.

lua
Custom.GetVehicleKeys = function(source, plate)
    TriggerClientEvent("vehiclekeys:client:SetOwner", source, plate)
end

Custom.GetVehicleData(plate){ owner } | false

Returns the owner identifier for a vehicle by plate from the framework's vehicle table.


Custom.PlateGenerator()string

Generate a custom license plate. Implement your own logic here.

lua
Custom.PlateGenerator = function()
    local plate = ''
    -- your plate generation logic
    return plate
end

Custom.QueryGiveBusinesscar(values) / Custom.QueryRemoveBusinesscar(values)

Insert or delete a vehicle from the framework's vehicle table when a business vehicle is assigned/removed.


Custom.SendBillfalse | function

Override the default bill creation logic. Set to a function to use your own billing system:

lua
Custom.SendBill = function(data, cb)
    -- data: { senderSource, receiverSource, price, concept, business }
    -- cb(true) on success, cb('error message') on failure
    local success = MySQL.insert.await('INSERT INTO bills (...) VALUES (...)', {...})
    cb(success or 'Failed to send bill')
end