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.
exports['origen_admin']:HasPermission(source, permission)| Parameter | Type | Description |
|---|---|---|
source | number | Player server ID |
permission | string | Permission node (e.g. 'AdminMenu', 'AdminMenu:Ban') |
Example — gate a custom action:
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.
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).
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.
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.
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)
})| Field | Type | Description |
|---|---|---|
type | string | Log type key — must match a key in Config.Logs |
source | number | nil | Server ID — appends player identifiers to the log if Config.UseIdentifiers = true |
embed | table | nil | Discord embed object |
message | string | nil | Plain text content (used instead of embed) |
Client-side exports
isSpectateEnabled() → boolean
Returns true if the local admin is currently in spectate mode.
local spectating = exports['origen_admin']:isSpectateEnabled()AddKeyBind(data) → id
Register a custom keybind in the admin menu keybind system.
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.
exports['origen_admin']:SetDefaultBind(id, 'F8')RemoveKeyBind(id)
Remove a previously registered keybind.
exports['origen_admin']:RemoveKeyBind(id)GetKeyBinds() → table
Returns the full list of registered keybinds.
local binds = exports['origen_admin']:GetKeyBinds()