Framework.ItemList for esx and a catchall for qbox
This commit is contained in:
1 parent
6443d728d4
commit
33a9b6ba69
4 files changed
+39
No files matched your search
@@ -14,6 +14,28 @@ Framework.GetFrameworkName = function()
|
||||
return 'es_extended'
|
||||
end
|
||||
|
||||
-- This is an internal function, its here to attempt to emulate qbs shared items mainly.
|
||||
Framework.ItemList = function()
|
||||
local items = ESX.Items
|
||||
local repackedTable = {}
|
||||
for k, v in pairs(items) do
|
||||
if v.label then
|
||||
repackedTable[k] = {
|
||||
name = k,
|
||||
label = v.label,
|
||||
weight = v.weight,
|
||||
type = "item",
|
||||
image = k .. ".png",
|
||||
unique = false,
|
||||
useable = true,
|
||||
shouldClose = true,
|
||||
description = 'No description provided.',
|
||||
}
|
||||
end
|
||||
end
|
||||
return { Items = repackedTable or {} }
|
||||
end
|
||||
|
||||
---This will return if the player is an admin in the framework.
|
||||
---@param src any
|
||||
---@return boolean
|
||||
@@ -457,6 +479,11 @@ Callback.Register('community_bridge:Callback:GetFrameworkJobs', function(source)
|
||||
return Framework.GetFrameworkJobs() or {}
|
||||
end)
|
||||
|
||||
-- This is linked to an internal function, its an attempt to standardize the item list across frameworks.
|
||||
Callback.Register('community_bridge:Callback:GetFrameworkItems', function(source)
|
||||
return Framework.ItemList() or {}
|
||||
end)
|
||||
|
||||
Framework.Commands = {}
|
||||
Framework.Commands.Add = function(name, help, arguments, argsrequired, callback, permission, ...)
|
||||
ESX.RegisterCommand(name, permission, function(xPlayer, args, showError)
|
||||
|
||||
Reference in new issue
Block a user