Home › Documentation › 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, integrationsControls 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.
Framework.GetLocalIdentifier() → string | nilReturns 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() → tableReturns 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() → stringReturns the player's current gang name or "none".
Framework.GetPlayerBusinesses() → tableReturns the player's active businesses from statebag.
Framework.GetPlayer(source) → table | nilReturns 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 | nilReturns the player's unique identifier (citizenid for QB, license for ESX/standalone).
Framework.HasAdminPermission(source) → booleanChecks if a player has admin access. Resolution order based on Config.AdminSystem:
origen_admin — checks origen_admin permission "origen_quests"ace — checks IsPlayerAceAllowed(source, Config.AdminAceNode)license — checks Config.AdminLicenses listcustom — calls Config.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) → booleanChecks if the player has at least amount of item. Auto-detects inventory system.
Framework.AddItem(source, item, amount) → booleanAdds items to the player's inventory. Returns true on success.
Framework.RemoveItem(source, item, amount) → booleanRemoves items from the player's inventory. Returns true on success.
Framework.GetItems() → tableReturns all registered items from the active inventory system. Used to populate the admin item picker.
Framework.GetItemByName(source, itemName) → tableReturns item data (with count/amount) for a specific player.
Framework.GetItemMetadata(itemName) → tableReturns item metadata (name, label, image, description) by item name.
These functions are called by the core script to resolve integrations. Override them in sv_framework.lua for full control.
Framework.GetPlayerAffiliationsCustom(source) → table | nilCalled 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() → tableCalled when Config.Integrations.gangs.mode = 'custom'. Must return an array:
return {
{ id = "mafia", label = "Mafia" },
{ id = "ballas", label = "Ballas" },
}Framework.GetBusinessesCustom() → tableCalled when Config.Integrations.businesses.mode = 'custom'. Must return an array:
return {
{ id = "auto_shop", label = "Auto Shop", grades = { "owner", "manager" } },
}Framework.SendPoliceDispatchCustom(source, data) → booleanCalled 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.