OrigenNetwork
Docs

Exports · origen_admin

All exports are registered under the resource name origen_admin.


Server-side exports

HasPermission(source, permission)boolean

Check if a player has a specific admin permission node. This is the primary export used by other resources to gate admin functionality.

lua
exports['origen_admin']:HasPermission(source, permission)
ParameterTypeDescription
sourcenumberPlayer server ID
permissionstringPermission node (e.g. 'AdminMenu', 'AdminMenu:Ban')

Example — gate a custom action:

lua
RegisterNetEvent('myresource:server:adminAction', function()
    local src = source
    if not exports['origen_admin']:HasPermission(src, 'AdminMenu:Ban') then return end
    -- execute action
end)

GetAdmins()table

Returns a table of all currently connected admins with admin mode enabled. Key = server ID, value = group name.

lua
local admins = exports['origen_admin']:GetAdmins()
-- { [3] = "admin", [7] = "god" }

IsAdminModeDisabled(source)boolean

Returns true if the player has admin mode manually disabled (via /admin_mode).

lua
local disabled = exports['origen_admin']:IsAdminModeDisabled(source)

ClearAdminGroup(source)

Clears a player's cached admin status and notifies their client to remove the admin group. Useful after changing permissions at runtime.

lua
exports['origen_admin']:ClearAdminGroup(source)

CreateLog(data)

Send a log to Discord (or the configured upload method). Uses Config.Logs to find the webhook for the given type.

lua
exports['origen_admin']:CreateLog({
    type   = 'BanPlayer',    -- must match a key in Config.Logs
    source = source,         -- optional: player server ID (adds identifiers if Config.UseIdentifiers = true)
    embed  = {               -- Discord embed object (optional)
        title       = 'Player Banned',
        description = 'Player was banned for cheating',
        color       = 16711680,
    },
    message = '',            -- plain text content (alternative to embed)
})
FieldTypeDescription
typestringLog type key — must match a key in Config.Logs
sourcenumber | nilServer ID — appends player identifiers to the log if Config.UseIdentifiers = true
embedtable | nilDiscord embed object
messagestring | nilPlain text content (used instead of embed)

Client-side exports

isSpectateEnabled()boolean

Returns true if the local admin is currently in spectate mode.

lua
local spectating = exports['origen_admin']:isSpectateEnabled()

AddKeyBind(data)id

Register a custom keybind in the admin menu keybind system.

lua
local id = exports['origen_admin']:AddKeyBind({
    label  = 'My Action',
    key    = 'F7',
    action = function() print('triggered') end,
})

SetDefaultBind(id, key)

Change the default key for an existing keybind.

lua
exports['origen_admin']:SetDefaultBind(id, 'F8')

RemoveKeyBind(id)

Remove a previously registered keybind.

lua
exports['origen_admin']:RemoveKeyBind(id)

GetKeyBinds()table

Returns the full list of registered keybinds.

lua
local binds = exports['origen_admin']:GetKeyBinds()