AllPeds
This function was added in DSL 5
Description
Returns an iterator function that will return each valid ped one at a time.
function AllPeds() --[[ ... ]] end
Parameters
None.
Return Values
iterator
:fun(): integer ped
- An iterator function that returns each valid ped in the game world.
Example
Iterate through all peds in the game world and print their names:
for ped in AllPeds() do
print(PedGetName(ped))
end
--> N_Jimmy
--> N_Trent
--> N_Parker
--> etc...
See Also
- Game's Native
PedFindInAreaXYZ
- Returns all peds within a specified 3D area.PedGetName