1
0
cuberite-2a/MCServer/Plugins/Core/playerlist.lua

14 lines
444 B
Lua
Raw Normal View History

2013-07-27 11:24:03 -04:00
function HandlePlayerListCommand( Split, Player )
local PlayerTable = {}
local AppendToTable = function( Player )
table.insert(PlayerTable, Player:GetName() )
end
Player:GetWorld():ForEachPlayer( AppendToTable )
local Message = cChatColor.Green .. "Connected players: (".. cChatColor.White.. #PlayerTable .. cChatColor.Green .. ")"
Player:SendMessage( Message )
Player:SendMessage( table.concat(PlayerTable, " ") )
return true
end