Just Cause 2: Multiplayer
Website
Home
/
Lua
/
Tutorials
/
Intermediate
/
Iterators
Some of the functions in the API use iterator functions. These must be used with for statements.
As an example, if you want to use
Server:GetPlayers
, use the following syntax:
for
player
in
Server:GetPlayers()
do
print
(player)
end
See also
Server:GetPlayers
Server:GetVehicles
Server:GetCheckpoints
World:GetPlayers
World:GetVehicles
World:GetCheckpoints
Client:GetPlayers
Client:GetStreamedPlayers
Client:GetVehicles