From fecbddd938e48fdec0eb12d1e19699e5a8554f6e Mon Sep 17 00:00:00 2001 From: PeppeSg <59803939+PeppeSess@users.noreply.github.com> Date: Tue, 5 May 2026 02:01:11 +0200 Subject: [PATCH] Update server.lua Added missing command registration support for the Qbox framework module. The ESX and QBCore framework modules already expose `Framework.Commands.Add`, but the Qbox module did not define `Framework.Commands`, causing resources that rely on the unified Community Bridge command API to fail on Qbox --- modules/framework/qbx_core/server.lua | 35 ++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/modules/framework/qbx_core/server.lua b/modules/framework/qbx_core/server.lua index f8431aa..7c33fd6 100644 --- a/modules/framework/qbx_core/server.lua +++ b/modules/framework/qbx_core/server.lua @@ -547,4 +547,37 @@ AddEventHandler("playerDropped", function() TriggerEvent("community_bridge:Server:OnPlayerUnload", src) end) -return Framework \ No newline at end of file +AddEventHandler("playerDropped", function() + local src = source + TriggerEvent("community_bridge:Server:OnPlayerUnload", src) +end) + +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 + +return Framework