From a0c0dbc3dd83d3b1aa19cb95462d19d33057a516 Mon Sep 17 00:00:00 2001 From: Gellipapa Date: Mon, 4 Sep 2023 22:48:58 +0200 Subject: [PATCH] :rotating_light: Solving backward compatibility --- [core]/es_extended/server/functions.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/[core]/es_extended/server/functions.lua b/[core]/es_extended/server/functions.lua index 91586005..3e60ac9b 100644 --- a/[core]/es_extended/server/functions.lua +++ b/[core]/es_extended/server/functions.lua @@ -256,8 +256,6 @@ local function checkTable(key, val, player, xPlayers) end function ESX.GetExtendedPlayers(key, val) - if not key then return ESX.Players end - local xPlayers = {} if type(val) == "table" then for _, v in pairs(ESX.Players) do @@ -265,7 +263,11 @@ function ESX.GetExtendedPlayers(key, val) end else for _, v in pairs(ESX.Players) do - if (key == 'job' and v.job.name == val) or v[key] == val then + if key then + if (key == 'job' and v.job.name == val) or v[key] == val then + xPlayers[#xPlayers + 1] = v + end + else xPlayers[#xPlayers + 1] = v end end