Replaced MaxPlayers with GetActivePlayers for all babies 👶

This commit is contained in:
ElPumpo
2019-07-20 13:09:42 +02:00
parent 954572c934
commit 9fa0c12e02
2 changed files with 4 additions and 7 deletions
+4 -6
View File
@@ -454,15 +454,13 @@ ESX.Game.GetClosestObject = function(filter, coords)
end
ESX.Game.GetPlayers = function()
local maxPlayers = Config.MaxPlayers
local players = {}
local players = {}
for i=0, maxPlayers, 1 do
local ped = GetPlayerPed(i)
for _,player in ipairs(GetActivePlayers()) do
local ped = GetPlayerPed(player)
if DoesEntityExist(ped) then
table.insert(players, i)
table.insert(players, player)
end
end