[ [ [ "Ciastuus", 28 ] ] ]
I create a list of players with information about them in php. And that's how it looks
The problem is that if there are more players, everything breaks down
@gpetersz do you have a discord?
Bad,
Okey,
function listPlayer( )
local players = {}
for _, player in ipairs( getElementsByType ("player") ) do
local name = getPlayerName( player )
local ping = getPlayerPing( player )
table.insert( players, ping )
end
return players
end
Use,
function listPing ()
local players = {}
local playername = getPlayerName( player )
local ping = getPlayerPing( player )
table.insert( players, {playername, ping} )
return players
end
And ...
Hey!
Would someone tell me how to do getPlayerPing for the php sdk library?
I only managed to make a list of players on the server
function listPlayer( )
local players = {}
for k, player in ipairs( getElementsByType ("player") ) do
local player = getPlayerName( player )
table.insert( players, player )
end
return players
end