Merge pull request #1195 from Arctos2win/patch-8

Improve the way the identifier is fetched
This commit is contained in:
Gellipapa
2023-09-02 15:13:53 +02:00
committed by GitHub
+13 -11
View File
@@ -31,17 +31,19 @@ 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 = GetPlayerIdentifierByType(source, PRIMARY_IDENTIFIER)
if not identifier then
return
end
identifier = identifier:gsub(PRIMARY_IDENTIFIER .. ':', '')
return identifier
end
if next(ESX.Players) then