Custom · origen_chat
The custom/ folder lets you integrate any framework, notification system or chat gate without touching the core. All files are escrow_ignore — they survive updates.
custom/
├── client/
│ ├── framework.lua — player job (client-side)
│ ├── notify.lua — notifications
│ └── chat.lua — chat open gate, raw message hook
└── server/
├── framework.lua — player identifier, name, job, group
└── permissions.lua — permission checkcustom/client/framework.lua
Custom.GetPlayerJob() → { name, label?, grade: { name, level } }
Returns the local player's current job. Dispatches to Config.Framework.
Custom.GetPlayerJob = function()
-- 'qb-core' / 'qbx_core' → Framework.Functions.GetPlayerData().job
-- 'esx' → Framework.GetPlayerData().job (normalized)
-- 'standalone' → { name = 'unknown', grade = { name = 'unknown', level = 0 } }
endcustom/client/notify.lua
Custom.Notify(text, type, length)
Show a notification to the local player. Called when Config.CustomNotify = true.
Custom.Notify = function(text, type, length)
lib.notify({
description = text,
type = type, -- 'info' | 'success' | 'error'
duration = length,
})
endcustom/client/chat.lua
Custom.CanOpenChat() → boolean
Gate whether the local player can open the chat input. Return false to block it (e.g. during a cutscene).
Custom.CanOpenChat = function()
return true
endCustom.OnSendNoCommandMessage(playerId, message)
Called when a player sends a message that does not start with /. Implement your own no-command chat handler here.
Custom.OnSendNoCommandMessage = function(playerId, message)
-- Example: route to a default /say command
-- TriggerServerEvent('origen_chat:server:say', message)
endcustom/server/framework.lua
| Function | Returns | Description |
|---|---|---|
Custom.GetIdentifier(source) | string | nil | Player unique identifier |
Custom.GetPlayerName(source) | string | Player full name or 'Unknown' |
Custom.GetPlayerJob(source) | { name, label, grade } | Player job and grade |
Custom.GetGroup(source) | string | table | Player permission group |
All functions dispatch automatically based on Config.Framework (qb-core, qbx_core, esx, standalone).
custom/server/permissions.lua
Custom.hasPermission(source, permissions) → boolean, string
Check if a player belongs to any of the given permission groups. Used by commands with a permissions field in Config.Commands.
Custom.hasPermission = function(source, permissions)
-- permissions: array of group names (e.g. { 'admin', 'god' })
-- returns: true if the player's group is in the list
end