OrigenNetwork
Docs

Custom · origen_doorlock

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

text
custom/
├── client/
│   ├── framework.lua  — player identifier, job, gang
│   └── notify.lua     — notifications, draw text, hide text
└── server/
    ├── framework.lua  — player group, identifier
    ├── permissions.lua — admin/permission check
    └── logs.lua       — Discord webhook logging

custom/client/framework.lua

Framework.GetPlayerIdentifier()string | nil

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

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

Framework.GetPlayerJob()string

Returns the local player's current job name.

lua
Framework.GetPlayerJob = function()
    return 'unemployed'
end

Framework.GetPlayerJobGroup()number

Returns the local player's job grade level.

lua
Framework.GetPlayerJobGroup = function()
    return 0
end

Framework.GetPlayerGang()string

Returns the local player's gang name. Returns 'none' by default.

lua
Framework.GetPlayerGang = function()
    return 'none'
end

Framework.GetPlayerGangGrade()number

Returns the local player's gang grade. Returns 0 by default.

lua
Framework.GetPlayerGangGrade = function()
    return 0
end

custom/client/notify.lua

Custom.Notify(text, type, length)

Show a notification to the local player.

lua
Custom.Notify = function(text, type, length)
    -- Add your custom notification here
end

Supported out of the box: qb-core (Framework.Functions.Notify) and esx (Framework.ShowNotification).


Custom.DrawText(text, key)

Show an interaction hint text (e.g. [E] - Open door).

Supported via Config.Drawtext: qb-core, esx_textui, ox_lib.

lua
Custom.DrawText = function(text, key)
    -- Add your custom draw text here
end

Custom.HideText()

Hide the interaction hint text.

lua
Custom.HideText = function()
    -- Add your custom hide text here
end

custom/server/framework.lua

Framework.GetGroup(source)string

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

lua
Framework.GetGroup = function(source)
    -- Config.Framework == 'custom': implement here
    return 'user'
end

Framework.GetIdentifier(source)string | nil

Returns the player's unique identifier server-side.

lua
Framework.GetIdentifier = function(source)
    return nil
end

custom/server/permissions.lua

Custom.hasPermission(source)boolean

Checks whether a player has permission to use the door management commands. Validates against Config.GroupPermissions using both framework groups and FiveM Ace Permissions (IsPlayerAceAllowed).

lua
Custom.hasPermission = function(src)
    -- Default: checks Config.GroupPermissions via framework group + ace permissions
    -- To override:
    return false
end

custom/server/logs.lua

Custom.DiscordLog(title, message, webHook)

Sends a Discord embed log to the given webhook URL. Automatically skips if the webhook is empty or is the default placeholder 'YOUR_DISCORD_WEBHOOK'.

lua
Custom.DiscordLog = function(title, message, webHook)
    -- Default implementation sends a Discord embed via PerformHttpRequest
    -- To use a different logging system, replace this function:
    print('[DoorLock] ' .. title .. ': ' .. message)
end

The three webhook slots are configured in Config.Logs:

SlotFired when
Config.Logs.CreateDoorA new door is created via the management menu
Config.Logs.DeleteDoorA door is deleted via the management menu
Config.Logs.DoorsUsageA door is locked or unlocked by a player