Improve the way the identifier is fetched

This commit is contained in:
Arctos2win
2023-09-01 17:58:06 +02:00
committed by GitHub
parent 534bbb99cf
commit d755a57e8f
+7 -11
View File
@@ -31,17 +31,13 @@ local PREFIX = Config.Prefix or 'char'
local PRIMARY_IDENTIFIER = ESX.GetConfig().Identifier or GetConvar('sv_lan', '') == 'true' and 'ip' or "license"
local function GetIdentifier(source)
local fxDk = GetConvarInt('sv_fxdkMode', 0)
if fxDk == 1 then
return "ESX-DEBUG-LICENCE"
end
local identifier = PRIMARY_IDENTIFIER..':'
for _, v in pairs(GetPlayerIdentifiers(source)) do
if string.match(v, identifier) then
identifier = string.gsub(v, identifier, '')
return identifier
end
end
local fxDk = GetConvarInt('sv_fxdkMode', 0)
if fxDk == 1 then
return "ESX-DEBUG-LICENCE"
end
local identifier = string.gsub(GetPlayerIdentifierByType(source, PRIMARY_IDENTIFIER), PRIMARY_IDENTIFIER .. ':', '')
return identifier
end
if next(ESX.Players) then