fxdk handling + naming + duplicate license

This commit is contained in:
Kakarot
2023-11-13 03:28:14 -06:00
parent a866b1a049
commit d7323ba147
5 changed files with 39 additions and 87 deletions
+4 -9
View File
@@ -22,7 +22,8 @@ end
---@param idtype string
---@return string?
function QBCore.Functions.GetIdentifier(source, idtype)
return GetPlayerIdentifierByType(source, idtype or "license")
if GetConvarInt('sv_fxdkMode', 0) == 1 then return 'license:fxdk' end
return GetPlayerIdentifierByType(source, idtype or 'license')
end
---Gets a players server id (source). Returns 0 if no player is found.
@@ -537,14 +538,8 @@ end
function QBCore.Functions.IsLicenseInUse(license)
local players = GetPlayers()
for _, player in pairs(players) do
local identifiers = GetPlayerIdentifiers(player)
for _, id in pairs(identifiers) do
if string.find(id, 'license') then
if id == license then
return true
end
end
end
local playerLicense = QBCore.Functions.GetIdentifier(player, 'license')
if playerLicense == license then return true end
end
return false
end