Custom · origen_banking
custom/
├── client/
│ ├── framework.lua
│ └── notify.lua
├── server/
│ ├── framework.lua
│ └── inventory.lua
└── shared/
└── notify.luaEvery file under custom/ is listed in escrow_ignore, so it is fully editable. Never call framework exports directly from these files when a bridge method already exists — extend bridge/framework/<name>/server.lua instead.
custom/server/framework.lua
Player resolution
Thin wrappers over the active framework bridge. They rarely need changes.
Internal.GetPlayerData(source) -- Framework player object
Internal.GetPlayerIdentifier(source) -- citizenid / identifier
Internal.GetPlayername(source) -- character display nameInternal.GetMoney(source, account) → number
Returns the player's balance for the given account type. When account is 'cash' and cash is an inventory item, it reads the item count instead of the framework account.
Internal.GetMoney = function(source, account)
if account == 'cash' and Custom.CashIsInventoryItem() then
return Custom.GetCashItem(source)
end
return Framework.GetAccountBalance(tonumber(source), account)
end| Parameter | Type | Description |
|---|---|---|
source | number | Server ID of the player |
account | string | Account type. Only 'cash' is customized here; anything else falls through to the framework |
Internal.AddMoney(source, account, amount, reason) → boolean
Grants money to the player. Returns false on invalid or non-positive amounts.
| Parameter | Type | Description |
|---|---|---|
source | number | Server ID of the player |
account | string | Account type |
amount | number | Positive amount to add |
reason | string | Optional label for logs and extended frameworks |
Internal.RemoveMoney(source, account, amount, reason) → boolean
Deducts money from the player. Returns false when the player does not have enough.
Custom.IsJobBoss(source, jobName) → boolean
Returns true when the player is the boss of the given job. Called whenever job account access is evaluated.
Custom.IsJobBoss = function(source, jobName)
local src = tonumber(source)
if not src or src <= 0 then return false end
local jobData = Framework.GetPlayerJobData(src)
if not jobData then return false end
return jobData.jobName == jobName and jobData.boss == true
endTo gate access by grade level instead of the isboss flag:
Custom.IsJobBoss = function(source, jobName)
local job = Framework.GetPlayerJobData(tonumber(source))
return job ~= nil and job.jobName == jobName and job.gradeRank >= 3
endCustom.HasJobBankAccess(source, jobName) → boolean
Returns true when the player should see and operate the job account. Defaults to boss-only. Manually granted users are handled separately through usersAccess.
Widen it to every employee:
Custom.HasJobBankAccess = function(source, jobName)
local job = Framework.GetPlayerJobData(tonumber(source))
return job ~= nil and job.jobName == jobName
endCustom.GetPlayerGangName(source) → string | nil
Returns the gang the player belongs to, or nil. Reads PlayerData.gang on QB/QBX. ESX has no native gang support and returns nil.
Custom.GetPlayerGangName = function(source)
return exports['my_gangs']:GetPlayerGang(source)
endCustom.IsGangBoss(source, gangName) → boolean
Returns true when the player is the boss of the given gang.
Custom.IsGangBoss = function(source, gangName)
local Player = Framework.GetPlayer(source)
local gang = Player and Player.PlayerData.gang
return gang and gang.name == gangName and gang.grade.level >= 2
endCustom.HasGangBankAccess(source, gangName) → boolean
Returns true when the player should see and operate the gang account. Defaults to boss-only.
custom/server/inventory.lua
Handles cash as an inventory item. Custom.CashItem resolves to 'cash' on origen_inventory outside ESX, and 'money' everywhere else.
Custom.CashIsInventoryItem() → boolean
Returns true when the active inventory bridge owns cash. When false, all cash operations fall back to the framework account.
Custom.GetCashItem(source) → number
Returns the amount of the cash item the player is carrying. Falls back to the framework balance when the bridge has no GetItemCount.
Custom.AddCashItem(source, amount) → boolean
Gives cash to the player as an inventory item.
Custom.RemoveCashItem(source, amount) → boolean
Removes cash from the player. Returns false when the player does not carry enough.
custom/shared/notify.lua
Custom.Notify(data)
Single entry point for every notification. Runs on both sides — on the server it forwards to the client, on the client it delegates to the notify bridge.
| Field | Type | Description |
|---|---|---|
title | string | Notification title |
description | string | Body text |
type | string | Notification type |
duration | number | Duration in milliseconds |
source | number | Target player, server side only. Defaults to -1 |
Custom.Notify = function(data)
if isServer then
TriggerClientEvent('ox_lib:notify', data.source or -1, data)
else
Notify.SendNotification(data.title, data.description, data.type, data.duration)
end
endcustom/client/notify.lua
Custom.DrawText(text, key)
Shows the interaction hint near banks and ATMs, formatted as [key] - text.
Custom.HideText()
Hides the currently displayed hint.
custom/client/framework.lua
Internal.isPlayerLoaded() → boolean
Returns true once the player character is fully loaded. Checks citizenid on QB/QBX and identifier on ESX.
Internal.GetPlayerIdentifier() → string | nil
Returns the local player's identifier.