Update functions.lua

This commit is contained in:
Arctos2win
2023-09-29 23:11:12 +02:00
committed by GitHub
parent f61e6648dd
commit 6fc40c7c49
+5 -4
View File
@@ -426,13 +426,14 @@ function ESX.Game.GetPlayers(onlyOtherPlayers, returnKeyValue, returnPeds)
local active = GetActivePlayers()
for i=1, #active do
local ped = GetPlayerPed(active[i])
local currentPlayer = active[i]
local ped = GetPlayerPed(currentPlayer)
if DoesEntityExist(ped) and ((onlyOtherPlayers and active[i] ~= myPlayer) or not onlyOtherPlayers) then
if DoesEntityExist(ped) and ((onlyOtherPlayers and currentPlayer ~= myPlayer) or not onlyOtherPlayers) then
if returnKeyValue then
players[active[i]] = ped
players[currentPlayer] = ped
else
players[#players + 1] = returnPeds and ped or active[i]
players[#players + 1] = returnPeds and ped or currentPlayer
end
end
end