From d755a57e8fef2b4f24871b5ff306472d0c3d296c Mon Sep 17 00:00:00 2001 From: Arctos2win <116841243+Arctos2win@users.noreply.github.com> Date: Fri, 1 Sep 2023 17:58:06 +0200 Subject: [PATCH] Improve the way the identifier is fetched --- [core]/esx_multicharacter/server/main.lua | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/[core]/esx_multicharacter/server/main.lua b/[core]/esx_multicharacter/server/main.lua index 15058c75..b55704cb 100644 --- a/[core]/esx_multicharacter/server/main.lua +++ b/[core]/esx_multicharacter/server/main.lua @@ -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