summaryrefslogtreecommitdiffstats
path: root/Plugins/Core/playerlist.lua
blob: 63990e825f3cce6d02a1da75ca7a0f00da3e5bd4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
local PlayerTable = {}

function HandlePlayerListCommand( Split, Player )
	PlayerTable = {}
	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

function AppendToTable( Player )
	table.insert(PlayerTable, Player:GetName() )
end