Merge pull request #193 from PeppeSess/patch-1
Added missing command registration support for the Qbox framework module.
This commit is contained in:
1 file changed
+27
-1
@@ -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
|
||||
Reference in new issue
Block a user