2012-02-14 14:14:23 -05:00
|
|
|
local PlayerTable = {}
|
|
|
|
|
2012-01-26 17:44:37 -05:00
|
|
|
function HandlePlayerListCommand( Split, Player )
|
2012-02-14 14:14:23 -05:00
|
|
|
PlayerTable = {}
|
|
|
|
Player:GetWorld():ForEachPlayer( AppendToTable )
|
2012-01-26 17:44:37 -05:00
|
|
|
|
2012-02-14 14:14:23 -05:00
|
|
|
local Message = cChatColor.Green .. "Connected players: (".. cChatColor.White.. #PlayerTable .. cChatColor.Green .. ")"
|
2012-01-26 17:44:37 -05:00
|
|
|
Player:SendMessage( Message )
|
2012-02-14 14:14:23 -05:00
|
|
|
|
2012-01-26 17:44:37 -05:00
|
|
|
Player:SendMessage( table.concat(PlayerTable, " ") )
|
|
|
|
return true
|
2012-02-14 14:14:23 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
function AppendToTable( Player )
|
|
|
|
table.insert(PlayerTable, Player:GetName() )
|
2012-01-26 17:44:37 -05:00
|
|
|
end
|