🚨 Solving backward compatibility

This commit is contained in:
Gellipapa
2023-09-04 22:48:58 +02:00
parent b644f1f2e9
commit a0c0dbc3dd
+5 -3
View File
@@ -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