mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
feat(client/resource): RegisterCommand wrapper
All these tweaks so we can check ACL for client commands.
This commit is contained in:
12
resource/client.lua
Normal file
12
resource/client.lua
Normal 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
|
||||
Reference in New Issue
Block a user