mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 18:28:52 +00:00
Merge pull request #1195 from Arctos2win/patch-8
Improve the way the identifier is fetched
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user