More changes

This commit is contained in:
Kakarot
2022-03-30 01:04:59 -05:00
parent 46a2aae5ce
commit dd6c6c4a09
4 changed files with 16 additions and 24 deletions
+13 -21
View File
@@ -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