OrigenNetwork
Docs

Custom · origen_banking

text
custom/
├── client/
│   ├── framework.lua
│   └── notify.lua
├── server/
│   ├── framework.lua
│   └── inventory.lua
└── shared/
    └── notify.lua

Every 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.

lua
Internal.GetPlayerData(source)        -- Framework player object
Internal.GetPlayerIdentifier(source)  -- citizenid / identifier
Internal.GetPlayername(source)        -- character display name

Internal.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.

lua
Internal.GetMoney = function(source, account)
    if account == 'cash' and Custom.CashIsInventoryItem() then
        return Custom.GetCashItem(source)
    end
    return Framework.GetAccountBalance(tonumber(source), account)
end
ParameterTypeDescription
sourcenumberServer ID of the player
accountstringAccount 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.

ParameterTypeDescription
sourcenumberServer ID of the player
accountstringAccount type
amountnumberPositive amount to add
reasonstringOptional 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.

lua
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
end

To gate access by grade level instead of the isboss flag:

lua
Custom.IsJobBoss = function(source, jobName)
    local job = Framework.GetPlayerJobData(tonumber(source))
    return job ~= nil and job.jobName == jobName and job.gradeRank >= 3
end

Custom.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:

lua
Custom.HasJobBankAccess = function(source, jobName)
    local job = Framework.GetPlayerJobData(tonumber(source))
    return job ~= nil and job.jobName == jobName
end

Custom.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.

lua
Custom.GetPlayerGangName = function(source)
    return exports['my_gangs']:GetPlayerGang(source)
end

Custom.IsGangBoss(source, gangName)boolean

Returns true when the player is the boss of the given gang.

lua
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
end

Custom.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.

FieldTypeDescription
titlestringNotification title
descriptionstringBody text
typestringNotification type
durationnumberDuration in milliseconds
sourcenumberTarget player, server side only. Defaults to -1
lua
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
end

custom/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.