Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR LUA

FiveM Lua How to create table of all online player id

for _, playerId in ipairs(GetPlayers()) do
  local name = GetPlayerName(playerId)
  print(('Player %s with id %i is in the server'):format(name, playerId))
  -- ('%s'):format('text') is same as string.format('%s', 'text)
end
Source by docs.fivem.net #
 
PREVIOUS NEXT
Tagged: #FiveM #Lua #How #create #table #online #player #id
ADD COMMENT
Topic
Name
7+5 =