diff --git a/server/commands.lua b/server/commands.lua index d4e59b2..ac974a7 100644 --- a/server/commands.lua +++ b/server/commands.lua @@ -27,7 +27,7 @@ function QBCore.Commands.Refresh(source) for command, info in pairs(QBCore.Commands.List) do local isGod = QBCore.Functions.HasPermission(src, 'god') local hasPerm = QBCore.Functions.HasPermission(src, QBCore.Commands.List[command].permission) - local isPrincipal = IsPrincipalAceAllowed('group.admin', 'command') + local isPrincipal = IsPlayerAceAllowed(src, 'command') if isGod or hasPerm or isPrincipal then suggestions[#suggestions+1] = { name = '/' .. command, diff --git a/server/events.lua b/server/events.lua index 91a21a9..f0ff342 100644 --- a/server/events.lua +++ b/server/events.lua @@ -21,7 +21,7 @@ AddEventHandler('chatMessage', function(source, n, message) if Player then local isGod = QBCore.Functions.HasPermission(src, 'god') local hasPerm = QBCore.Functions.HasPermission(src, QBCore.Commands.List[command].permission) - local isPrincipal = IsPrincipalAceAllowed('group.admin', 'command') + local isPrincipal = IsPlayerAceAllowed(src, 'command') table.remove(args, 1) if isGod or hasPerm or isPrincipal then if (QBCore.Commands.List[command].argsrequired and #QBCore.Commands.List[command].arguments ~= 0 and args[#QBCore.Commands.List[command].arguments] == nil) then @@ -196,7 +196,7 @@ RegisterNetEvent('QBCore:CallCommand', function(command, args) if Player then local isGod = QBCore.Functions.HasPermission(src, 'god') local hasPerm = QBCore.Functions.HasPermission(src, QBCore.Commands.List[command].permission) - local isPrincipal = IsPrincipalAceAllowed('group.admin', 'command') + local isPrincipal = IsPlayerAceAllowed(src, 'command') if (QBCore.Commands.List[command].permission == Player.PlayerData.job.name) or isGod or hasPerm or isPrincipal then if (QBCore.Commands.List[command].argsrequired and #QBCore.Commands.List[command].arguments ~= 0 and args[#QBCore.Commands.List[command].arguments] == nil) then TriggerClientEvent('QBCore:Notify', src, 'All arguments must be filled out!', 'error')