diff --git a/server/commands.lua b/server/commands.lua index 7048ca1..bd1c728 100644 --- a/server/commands.lua +++ b/server/commands.lua @@ -21,6 +21,10 @@ function QBCore.Commands.Add(name, help, arguments, argsrequired, callback, perm if permission == 'user' then restricted = false end -- allow all users to use command RegisterCommand(name, function(source, args, rawCommand) -- Register command within fivem + + TriggerEvent('QBCore:Server:PreCommandExecution', source, name, args, rawCommand) + if WasEventCanceled() then return end + if argsrequired and #args < #arguments then return TriggerClientEvent('chat:addMessage', source, { color = { 255, 0, 0 },