diff --git a/config.lua b/config.lua index 9681f22..43de9d5 100644 --- a/config.lua +++ b/config.lua @@ -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 = {'admin', 'mod'} -- Add as many groups as you want here after creating them in your server.cfg +QBConfig.Server.Permissions = {'god', 'admin', 'mod'} -- Add as many groups as you want here after creating them in your server.cfg QBConfig.Notify = {} diff --git a/server/commands.lua b/server/commands.lua index 144eb2b..667e7cb 100644 --- a/server/commands.lua +++ b/server/commands.lua @@ -1,8 +1,7 @@ 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.admin allows all commands - ['admin'] = true, -- We don't need to create an ace because group.admin allows all commands + ['god'] = true, -- We don't need to create an ace because group.god allows all commands ['user'] = true -- We don't need to create an ace because builtin.everyone } diff --git a/server/functions.lua b/server/functions.lua index 7971c37..2311b3d 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -309,28 +309,20 @@ end -- Opt in or out of admin reports --- function QBCore.Functions.IsOptin(source) --- local license = QBCore.Functions.GetIdentifier(source, 'license') --- if not license or not QBCore.Functions.HasPermission(source, 'admin') then return false end --- if QBCore.Config.Server.UseOldPermissionSystem then --- return QBCore.Config.Server.PermissionList[license].optin --- else --- local Player = QBCore.Functions.GetPlayer(source) --- return Player.PlayerData.optin --- end --- end +function QBCore.Functions.IsOptin(source) + local license = QBCore.Functions.GetIdentifier(source, 'license') + if not license or not QBCore.Functions.HasPermission(source, 'admin') then return false end + local Player = QBCore.Functions.GetPlayer(source) + return Player.PlayerData.optin +end --- function QBCore.Functions.ToggleOptin(source) --- local license = QBCore.Functions.GetIdentifier(source, 'license') --- if not license or not QBCore.Functions.HasPermission(source, 'admin') then return end --- if QBCore.Config.Server.UseOldPermissionSystem then --- QBCore.Config.Server.PermissionList[license].optin = not QBCore.Config.Server.PermissionList[license].optin --- else --- local Player = QBCore.Functions.GetPlayer(source) --- Player.PlayerData.optin = not Player.PlayerData.optin --- Player.Functions.SetMetaData('optin', Player.PlayerData.optin) --- end --- end +function QBCore.Functions.ToggleOptin(source) + local license = QBCore.Functions.GetIdentifier(source, 'license') + if not license or not QBCore.Functions.HasPermission(source, 'admin') then return end + local Player = QBCore.Functions.GetPlayer(source) + Player.PlayerData.optin = not Player.PlayerData.optin + Player.Functions.SetMetaData('optin', Player.PlayerData.optin) +end -- Check if player is banned diff --git a/server/player.lua b/server/player.lua index b706e67..542cf15 100644 --- a/server/player.lua +++ b/server/player.lua @@ -44,6 +44,7 @@ function QBCore.Player.CheckPlayerData(source, PlayerData) PlayerData.name = GetPlayerName(source) PlayerData.cid = PlayerData.cid or 1 PlayerData.money = PlayerData.money or {} + PlayerData.optin = PlayerData.optin or true for moneytype, startamount in pairs(QBCore.Config.Money.MoneyTypes) do PlayerData.money[moneytype] = PlayerData.money[moneytype] or startamount end