mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
refactor(client/functions): ESX.Game.GetPeds
This commit is contained in:
@@ -537,10 +537,15 @@ function ESX.Game.GetObjects() -- Leave the function for compatibility
|
||||
end
|
||||
|
||||
function ESX.Game.GetPeds(onlyOtherPeds)
|
||||
local peds, myPed, pool = {}, ESX.PlayerData.ped, GetGamePool('CPed')
|
||||
local myPed, pool = ESX.PlayerData.ped, GetGamePool('CPed')
|
||||
|
||||
if not onlyOtherPeds then
|
||||
return pool
|
||||
end
|
||||
|
||||
local peds = {}
|
||||
for i = 1, #pool do
|
||||
if ((onlyOtherPeds and pool[i] ~= myPed) or not onlyOtherPeds) then
|
||||
if pool[i] ~= myPed then
|
||||
peds[#peds + 1] = pool[i]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user