mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-28 17:01:16 +00:00
Merge pull request #1222 from aysihuniks/main
feat(commands): add pre-execution middleware event
This commit is contained in:
@@ -28,6 +28,10 @@ function QBCore.Commands.Add(name, help, arguments, argsrequired, callback, perm
|
||||
args = { 'System', Lang:t('error.missing_args2') }
|
||||
})
|
||||
end
|
||||
|
||||
TriggerEvent('QBCore:Server:PreCommandExecution', source, name, args, rawCommand)
|
||||
if WasEventCanceled() then return end
|
||||
|
||||
callback(source, args, rawCommand)
|
||||
end, restricted)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user