mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 01:08:57 +00:00
fxdk handling + naming + duplicate license
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user