Merge pull request #193 from PeppeSess/patch-1

Added missing command registration support for the Qbox framework module.
This commit is contained in:
MrNewb authored and GitHub committed 2026-06-28 13:50:01 -04:00
commit 346d0d1757
1 file changed
+27 -1
+27 -1
View File
@@ -547,4 +547,30 @@ AddEventHandler("playerDropped", function()
TriggerEvent("community_bridge:Server:OnPlayerUnload", src)
end)
return Framework
Framework.Commands = Framework.Commands or {}
---@description Adds a command to the Qbox framework
---@param name string
---@param help string
---@param arguments table
---@param argsrequired boolean
---@param callback function
---@param permission string
---@param ... any
Framework.Commands.Add = function(name, help, arguments, argsrequired, callback, permission, ...)
lib.addCommand(name, {
help = help or "",
params = arguments or {},
restricted = false
}, function(source, args, raw)
if permission and permission ~= "user" then
if not Framework.GetIsFrameworkAdmin(source) then
return
end
end
callback(source, args or {}, raw)
end)
end
return Framework