feat(client/resource): RegisterCommand wrapper

All these tweaks so we can check ACL for client commands.
This commit is contained in:
Linden
2022-09-14 00:54:44 +10:00
parent 9d8584ff9e
commit bac9eb576d

12
resource/client.lua Normal file
View File

@@ -0,0 +1,12 @@
local _registerCommand = RegisterCommand
---@param commandName string
---@param callback fun(source, args, raw)
---@param restricted boolean?
function RegisterCommand(commandName, callback, restricted)
_registerCommand(commandName, function(source, args, raw)
if not restricted or lib.callback.await('ox_lib:checkPlayerAce', 100, ('command.%s'):format(commandName)) then
callback(source, args, raw)
end
end)
end