summaryrefslogblamecommitdiffstats
path: root/MCServer/Plugins/Core/playerlist.lua
blob: f06dfed85f0f077dd2a55237a9cd1d67b7d51aa1 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                  




                                                             
                                                         
 
                                                                                                                                
                                      
         


                                                             
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