mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 23:16:03 +01:00
13 lines
422 B
Lua
13 lines
422 B
Lua
|
|
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
|