From b04eb3f43af5c06ff94d13543e096e055abdfe51 Mon Sep 17 00:00:00 2001 From: Kakarot Date: Wed, 30 Mar 2022 17:05:07 -0500 Subject: [PATCH] Update to qbcore. --- server/commands.lua | 8 ++++---- server/functions.lua | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/server/commands.lua b/server/commands.lua index 7fadb88..457277d 100644 --- a/server/commands.lua +++ b/server/commands.lua @@ -1,13 +1,13 @@ QBCore.Commands = {} QBCore.Commands.List = {} QBCore.Commands.IgnoreList = { -- Ignore old perm levels while keeping backwards compatibility - ['god'] = true, -- We don't need to create an ace because group.god allows all commands + ['god'] = true, -- We don't need to create an ace because god is allowed all commands ['user'] = true -- We don't need to create an ace because builtin.everyone } -CreateThread(function() -- Add rank name to ace +CreateThread(function() -- Add ace to node for perm checking for k,v in pairs(QBConfig.Server.Permissions) do - ExecuteCommand(('add_ace group.%s %s allow'):format(v, v)) + ExecuteCommand(('add_ace qbcore.%s %s allow'):format(v, v)) end end) @@ -19,7 +19,7 @@ function QBCore.Commands.Add(name, help, arguments, argsrequired, callback, perm if permission == 'user' then restricted = false end -- allow all users to use command RegisterCommand(name, callback, restricted) -- Register command within fivem if not QBCore.Commands.IgnoreList[permission] then -- only create aces for extra perm levels - ExecuteCommand(('add_ace group.%s command.%s allow'):format(permission, name)) + ExecuteCommand(('add_ace qbcore.%s command.%s allow'):format(permission, name)) end QBCore.Commands.List[name:lower()] = { name = name:lower(), diff --git a/server/functions.lua b/server/functions.lua index 2311b3d..8b0bce6 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -266,7 +266,7 @@ end function QBCore.Functions.AddPermission(source, permission) local src = source local license = QBCore.Functions.GetIdentifier(src, 'license') - ExecuteCommand(('add_principal identifier.%s group.%s'):format(license, permission)) + ExecuteCommand(('add_principal identifier.%s qbcore.%s'):format(license, permission)) QBCore.Commands.Refresh(src) end @@ -275,13 +275,13 @@ function QBCore.Functions.RemovePermission(source, permission) local license = QBCore.Functions.GetIdentifier(src, 'license') if permission then if IsPlayerAceAllowed(src, permission) then - ExecuteCommand(('remove_principal identifier.%s group.%s'):format(license, permission)) + ExecuteCommand(('remove_principal identifier.%s qbcore.%s'):format(license, permission)) QBCore.Commands.Refresh(src) end else for k,v in pairs(QBCore.Config.Server.Permissions) do if IsPlayerAceAllowed(src, v) then - ExecuteCommand(('remove_principal identifier.%s group.%s'):format(license, v)) + ExecuteCommand(('remove_principal identifier.%s qbcore.%s'):format(license, v)) QBCore.Commands.Refresh(src) end end