mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 00:01:22 +00:00
More changes
This commit is contained in:
+1
-1
@@ -30,7 +30,7 @@ QBConfig.Server.WhitelistPermission = 'admin' -- Permission that's able to enter
|
||||
QBConfig.Server.PVP = true -- Enable or disable pvp on the server (Ability to shoot other players)
|
||||
QBConfig.Server.Discord = "" -- Discord invite link
|
||||
QBConfig.Server.CheckDuplicateLicense = true -- Check for duplicate rockstar license on join
|
||||
QBConfig.Server.Permissions = {'god', 'admin', 'mod'} -- Add as many groups as you want here after creating them in your server.cfg
|
||||
QBConfig.Server.Permissions = {'admin', 'mod'} -- Add as many groups as you want here after creating them in your server.cfg
|
||||
|
||||
QBConfig.Notify = {}
|
||||
|
||||
|
||||
+7
-1
@@ -3,9 +3,15 @@ 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.admin allows all commands
|
||||
['admin'] = true, -- We don't need to create an ace because group.admin allows all commands
|
||||
['user'] = true, -- We don't need to create an ace because builtin.everyone
|
||||
['user'] = true -- We don't need to create an ace because builtin.everyone
|
||||
}
|
||||
|
||||
CreateThread(function() -- Add rank name to ace
|
||||
for k,v in pairs(QBConfig.Server.Permissions) do
|
||||
ExecuteCommand(('add_ace group.%s %s allow'):format(v, v))
|
||||
end
|
||||
end)
|
||||
|
||||
-- Register & Refresh Commands
|
||||
|
||||
function QBCore.Commands.Add(name, help, arguments, argsrequired, callback, permission)
|
||||
|
||||
+4
-10
@@ -266,12 +266,8 @@ end
|
||||
function QBCore.Functions.AddPermission(source, permission)
|
||||
local src = source
|
||||
local license = QBCore.Functions.GetIdentifier(src, 'license')
|
||||
for k,v in pairs(QBCore.Config.Server.Permissions) do
|
||||
if permission == v then
|
||||
ExecuteCommand(('add_principal identifier.%s group.%s'):format(license, permission))
|
||||
QBCore.Commands.Refresh(src)
|
||||
end
|
||||
end
|
||||
ExecuteCommand(('add_principal identifier.%s group.%s'):format(license, permission))
|
||||
QBCore.Commands.Refresh(src)
|
||||
end
|
||||
|
||||
function QBCore.Functions.RemovePermission(source, permission)
|
||||
@@ -296,8 +292,7 @@ end
|
||||
|
||||
function QBCore.Functions.HasPermission(source, permission)
|
||||
local src = source
|
||||
local group = ('group.%s'):format(permission)
|
||||
if IsPlayerAceAllowed(tostring(src), group) then return true end
|
||||
if IsPlayerAceAllowed(src, permission) then return true end
|
||||
return false
|
||||
end
|
||||
|
||||
@@ -305,8 +300,7 @@ function QBCore.Functions.GetPermissions(source)
|
||||
local src = source
|
||||
local perms = {}
|
||||
for k,v in pairs (QBCore.Config.Server.Permissions) do
|
||||
local group = ('group.%s'):format(v)
|
||||
if IsPlayerAceAllowed(src, group) then
|
||||
if IsPlayerAceAllowed(src, v) then
|
||||
perms[v] = true
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user