Custom · origen_reports
custom/
└── server.luacustom/** is listed in escrow_ignore, so it is fully editable. Every function is server-side and reads the auto-detected Config.Framework, Config.Inventory, Config.Clothing and Config.Ambulance values. Add a new branch when your resource is not supported out of the box.
With ox_inventory, listing items, giving items and opening inventories are handled internally by the resource. Custom.getItemList, Custom.giveItem and Custom.openPlayerInventory are never called in that case, so editing them has no effect.
custom/server.lua
Custom.getIdentifier(source) → string | nil
Returns the unique identifier used to store reports and staff stats. Called whenever a player creates a report or a staff member is resolved.
| Framework | Returned value |
|---|---|
qb-core / qbx_core | PlayerData.citizenid |
esx | xPlayer.getIdentifier() |
| None | The license identifier |
Custom.getIdentifier = function(source)
local player = getFrameworkPlayer(source)
if Config.Framework == 'qb-core' or Config.Framework == 'qbx_core' then
return player and player.PlayerData and player.PlayerData.citizenid or nil
elseif Config.Framework == 'esx' then
return player and player.getIdentifier and player.getIdentifier() or nil
end
return GetPlayerIdentifierByType(source, 'license')
endChanging the identifier format after the resource has been in use orphans existing reports and staff stats, since they are keyed by this value.
Custom.hasConfigFullAccess(source) → boolean
Returns true when the player matches any permission in Config.StaffFullAccess.
Custom.hasConfigBasicAccess(source) → boolean
Returns true when the player matches any permission in Config.StaffBasicAccess.
Both go through the same internal check, applied to each permission of the list:
- ACE
<permission>orgroup.<permission>. qbx_core—exports.qbx_core:HasPermissionandGetPermission.qb-core—Framework.Functions.GetPermission.esx—xPlayer.getGroup() == permission.
Override them to plug in a custom permission system:
Custom.hasConfigFullAccess = function(source)
return exports['my_admin']:IsAdmin(source)
end
Custom.hasConfigBasicAccess = function(source)
return exports['my_admin']:IsModerator(source)
end| Parameter | Type | Description |
|---|---|---|
source | number | Server ID of the player |
Custom.getStaffLevel(source) → 'full' | 'basic' | false
Resolves the access level of a player from the two functions above. Full access wins when both match. Returns false when the player is not staff by config (they can still be limited staff if they were added with a group from the admin panel).
Custom.getStaffLevel = function(source)
local hasBasic = Custom.hasConfigBasicAccess(source)
local hasFull = Custom.hasConfigFullAccess(source)
if hasBasic and hasFull then
return 'full'
end
if hasBasic then
return 'basic'
end
if hasFull then
return 'full'
end
return false
endCustom.getItemList() → table
Returns every registered item as { name, label }, sorted by label. Used to fill the item picker of the give items quick action and the allowed items list of staff groups.
| Inventory | Source |
|---|---|
qb-inventory / ps-inventory | Framework.Shared.Items |
codem-inventory | exports['codem-inventory']:GetItemList() |
qs-inventory | exports['qs-inventory']:GetItemList() |
origen_inventory | exports.origen_inventory:Items() |
core_inventory | Framework.Shared.Items, or Framework.Items() on ESX |
tgiann-inventory | exports['tgiann-inventory']:GetItemList() |
| Any other | Framework.Shared.Items, or Framework.Items() on ESX |
To add an inventory, return its item table through the local mapItemTable helper:
elseif Config.Inventory == 'my_inventory' then
return mapItemTable(exports['my_inventory']:GetItemList())Custom.giveItem(source, item, count) → boolean
Gives an item to the reported player. Called by the give items quick action. Returns true on success by convention, although the resource does not read the return value.
| Parameter | Type | Description |
|---|---|---|
source | number | Server ID of the player receiving the item |
item | string | Item name |
count | number | Amount to give |
qs-inventory and tgiann-inventory check CanCarryItem first and return false when the player cannot carry it. Inventories without a branch fall back to the framework: Functions.AddItem on QB/Qbox and addInventoryItem on ESX.
elseif Config.Inventory == 'my_inventory' then
if not exports['my_inventory']:CanCarryItem(source, item, count) then return false end
return exports['my_inventory']:AddItem(source, item, count)Custom.openPlayerInventory(source, target) → boolean
Opens the reported player's inventory to the staff member. Called by the inventory quick action. Returns false when the inventory is not supported.
| Parameter | Type | Description |
|---|---|---|
source | number | Server ID of the staff member |
target | number | Server ID of the player whose inventory is opened |
| Inventory | Call |
|---|---|
qb-inventory | OpenInventory(source, target) |
ps-inventory | OpenInventoryById(source, target) |
origen_inventory | OpenInventory(source, 'otherplayer', target) |
core_inventory | openInventory(source, 'stash-<identifier>', 'stash', ...) |
tgiann-inventory | OpenInventoryById(source, target) |
jpr-inventory | OpenInventory(source, identifier) |
qs-inventory and codem-inventory have no branch here, so the inventory quick action returns false with them. Add their open call if you use one of them.
Custom.openClothingMenu(source) → boolean
Opens the clothing menu on the reported player. Called by the clothing quick action.
| Clothing | Client event |
|---|---|
illenium-appearance | illenium-appearance:client:openClothingShopMenu |
esx_skin | esx_skin:openMenu |
qb-clothing / fivem-appearance / rcore_clothing | qb-clothing:client:openMenu |
origen_clothing | origen_clothing:client:openOutfitMenu |
elseif Config.Clothing == 'my_clothing' then
TriggerClientEvent('my_clothing:client:openMenu', source)
return trueCustom.revivePlayer(source) → boolean
Revives the reported player. Called by the revive quick action.
| Ambulance | Call |
|---|---|
qb-ambulancejob / qbx_medical | Client event hospital:client:Revive |
esx_ambulancejob | Server event esx_ambulancejob:revive |
wasabi_ambulance | Server event wasabi_ambulance:revivePlayer |
| None on ESX | Server event esx_ambulancejob:revive |
| None on QB/Qbox | Client event hospital:client:Revive |
elseif Config.Ambulance == 'my_ambulance' then
TriggerClientEvent('my_ambulance:client:revive', source)
return true| Parameter | Type | Description |
|---|---|---|
source | number | Server ID of the player to revive |