OrigenNetwork
Docs

Custom · origen_clothing

The custom/ folder lets you integrate any framework, notification or store access logic without touching the core. All files here are escrow_ignore — they survive updates.

text
custom/
├── client/
│   ├── framework.lua  — player identifier, job, gender, loaded state
│   ├── notify.lua     — notifications and text UI
│   ├── store.lua      — gate who can open a store
│   └── visuals.lua    — hide/show HUD when clothing menu opens
└── server/
    ├── framework.lua  — player identifier, job, money, permissions, group, gender
    └── permissions.lua — admin check

custom/client/framework.lua

Custom.GetPlayerIdentifier()string | nil

Returns the local player's unique identifier (citizenid / identifier).

lua
Custom.GetPlayerIdentifier = function()
    -- Config.Framework == 'custom': implement here
    return nil
end

Custom.GetJob(){ name, grade }

Returns the local player's current job name and grade level.

lua
Custom.GetJob = function()
    return { name = 'unemployed', grade = 0 }
end

Framework.GetGender()number

Returns the local player's gender. 0 = male, 1 = female.

lua
Framework.GetGender = function()
    -- Config.Framework == 'custom': implement here
end

Framework.isPlayerLoaded()boolean

Returns true when the player's data is ready and loaded.

lua
Framework.isPlayerLoaded = function()
    return false
end

custom/client/notify.lua

Custom.Notify(text, type, length)

Show a notification to the local player.

lua
Custom.Notify = function(text, type, length)
    lib.notify({
        description = text,
        type        = type,     -- 'info' | 'success' | 'error'
        duration    = length,
    })
end

Custom.DrawText(text, key)

Show a text UI interaction hint.

lua
Custom.DrawText = function(text, key)
    lib.showTextUI('[' .. key .. '] - ' .. text)
end

Custom.HideText()

Hide the text UI hint.

lua
Custom.HideText = function()
    lib.hideTextUI()
end

custom/client/store.lua

Custom.CanOpenStore(storeId)boolean

Gate whether the local player can open a specific store. Called before the store UI opens.

lua
Custom.CanOpenStore = function(storeId)
    -- Example: only allow police job to open store ID 1
    -- if storeId == 1 then
    --     return Custom.GetJob().name == 'police'
    -- end
    return true
end

custom/client/visuals.lua

Custom.HideVisuals(state)

Called when the clothing menu opens (state = true) or closes (state = false). Use this to hide/show your HUD, radar, minimap, etc.

lua
Custom.HideVisuals = function(state)
    -- Example:
    -- DisplayRadar(not state)
    -- SendNUIMessage({ type = 'hud', visible = not state })
end

custom/server/framework.lua

Custom.GetIdentifier(source)string | nil

Returns the unique identifier for a player server-side.

lua
Custom.GetIdentifier = function(source)
    -- Config.Framework == 'custom': implement here
    return nil
end

Custom.GetMoney(source, paymentMethod)number

Returns the player's balance for the given payment method. Falls back to Config.DefaultPaymentMethod if the method is invalid.

lua
Custom.GetMoney = function(source, paymentMethod)
    return 0
end

Custom.RemoveMoney(source, amount, paymentMethod)

Deducts money from the player's account.

lua
Custom.RemoveMoney = function(source, amount, paymentMethod)
end

Custom.GetJob(source){ name, grade }

Returns the player's current job and grade server-side.

lua
Custom.GetJob = function(source)
    return { name = 'unemployed', grade = 0 }
end

Custom.GetGroup(source)string

Returns the player's permission group (e.g. 'admin', 'god').

lua
Custom.GetGroup = function(source)
    return 'user'
end

Custom.GetGender(source)number | string

Returns the player's gender server-side. 0 / 'm' = male, 1 / 'f' = female.

lua
Custom.GetGender = function(source)
    return 0
end

Custom.HasPermission(source, group)boolean

Checks if a player belongs to a permission group.

lua
Custom.HasPermission = function(source, group)
    return false
end

custom/server/permissions.lua

Custom.IsAdmin(source)boolean

Checks whether a player is considered an admin based on Config.Permissions. Iterates the list and calls Custom.HasPermission for each group. If Config.Permissions is empty, all players are considered admins.

lua
Custom.IsAdmin = function(src)
    -- Default logic: checks each group in Config.Permissions
    -- To override:
    return false
end