12906c026d
git-svn-id: http://mc-server.googlecode.com/svn/trunk@763 0a769ca7-a7f5-676a-18bf-c427514a06d6
14 lines
457 B
Lua
14 lines
457 B
Lua
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 |