Custom · origen_quests
All custom files are excluded from CFX escrow encryption and are safe to edit.
custom/
├── cl_drawtext.lua -- Client: interaction text UI (key prompt at locations)
├── cl_framework.lua -- Client: framework, notifications, player data
└── sv_framework.lua -- Server: framework, admin, inventory, integrationscustom/cl_drawtext.lua
Controls the text prompt displayed when a player is near a quest location.
DrawQuestText(key, text)
Called when the player enters the interaction radius of a location. Default implementation uses ox_lib textUI.
function DrawQuestText(key, text)
lib.showTextUI("[" .. key .. "] - " .. text)
end| Parameter | Type | Description |
|---|---|---|
key | string | Key label to show (e.g. E) |
text | string | Interaction label from the location config |
HideQuestText()
Called when the player leaves the interaction radius.
function HideQuestText()
lib.hideTextUI()
endReplace these functions to use any drawtext or textUI system.
custom/cl_framework.lua
Framework.GetLocalIdentifier() → string | nil
Returns the local player's identifier (citizenid / license). Used for XP sync.
function Framework.GetLocalIdentifier()
-- qbx / qb
local ok, p = pcall(function() return exports.qbx_core:GetPlayerData() end)
return (ok and p) and p.citizenid or nil
endFramework.GetPlayerData() → table
Returns the full player data object from the framework. Used for UI metadata.
function Framework.GetPlayerData()
local ok, p = pcall(function() return exports.qbx_core:GetPlayerData() end)
return (ok and p) and p or {}
endFramework.NotifyClient(message, notifyType)
Sends a notification to the local client.
function Framework.NotifyClient(message, notifyType)
-- notifyType: 'inform' | 'success' | 'error' | 'warning'
lib.notify({ description = message, type = notifyType })
endAdapt this function when using Config.NotifySystem = 'custom' with a client event.
Framework.OnPlayerLoaded(callback)
Registers a callback that fires when the player finishes loading. Used to initialize quest data.
function Framework.OnPlayerLoaded(callback)
AddEventHandler('QBCore:Client:OnPlayerLoaded', callback)
endFramework.TriggerCallback(name, cb, ...)
Wraps lib.callback for server callbacks. You normally do not need to modify this.
Framework.GetPlayerGang() → string
Returns the player's current gang name or "none".
Framework.GetPlayerBusinesses() → table
Returns the player's active businesses from statebag.
custom/sv_framework.lua
Framework.GetPlayer(source) → table | nil
Returns the framework player object for the given source.
function Framework.GetPlayer(source)
local ok, p = pcall(function() return exports.qbx_core:GetPlayer(src) end)
return (ok and p) and p or nil
endFramework.GetIdentifier(source) → string | nil
Returns the player's unique identifier (citizenid for QB, license for ESX/standalone).
Framework.HasAdminPermission(source) → boolean
Checks if a player has admin access. Resolution order based on Config.AdminSystem:
origen_admin— checksorigen_adminpermission"origen_quests"ace— checksIsPlayerAceAllowed(source, Config.AdminAceNode)license— checksConfig.AdminLicenseslistcustom— callsConfig.AdminCustom.resource:Config.AdminCustom.hasPermission(source, permission)qb— checks player group (god,superadmin,admin)esx— checks player group (superadmin,admin)
Framework.Notify(source, message, ntype)
Sends a notification to a player server-side.
Framework.HasItem(source, item, amount) → boolean
Checks if the player has at least amount of item. Auto-detects inventory system.
Framework.AddItem(source, item, amount) → boolean
Adds items to the player's inventory. Returns true on success.
Framework.RemoveItem(source, item, amount) → boolean
Removes items from the player's inventory. Returns true on success.
Framework.GetItems() → table
Returns all registered items from the active inventory system. Used to populate the admin item picker.
Framework.GetItemByName(source, itemName) → table
Returns item data (with count/amount) for a specific player.
Framework.GetItemMetadata(itemName) → table
Returns item metadata (name, label, image, description) by item name.
Integration hooks
These functions are called by the core script to resolve integrations. Override them in sv_framework.lua for full control.
Framework.GetPlayerAffiliationsCustom(source) → table | nil
Called when Config.Integrations.affiliations.mode = 'custom'. Must return:
return {
gang = "mafia", -- string, gang name or "none"
businesses = { "auto_shop" } -- table of business IDs
}Framework.GetGangsCustom() → table
Called when Config.Integrations.gangs.mode = 'custom'. Must return an array:
return {
{ id = "mafia", label = "Mafia" },
{ id = "ballas", label = "Ballas" },
}Framework.GetBusinessesCustom() → table
Called when Config.Integrations.businesses.mode = 'custom'. Must return an array:
return {
{ id = "auto_shop", label = "Auto Shop", grades = { "owner", "manager" } },
}Framework.SendPoliceDispatchCustom(source, data) → boolean
Called when Config.Integrations.dispatch.mode = 'custom'. Receives:
-- data = { message = "...", title = "..." }
-- Return true if the alert was sent successfully.
function Framework.SendPoliceDispatchCustom(_source, _data)
exports['my_dispatch']:SendAlert(_source, _data)
return true
endFramework.CreateLog(data)
Called internally when admin actions occur. Forwards to origen_admin if running, falls back to SendDiscordLog event.