summaryrefslogtreecommitdiffstats
path: root/Plugins/Core/playerlist.lua
blob: c120f068f29f3c203e3ed88f4560b62636baf160 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function HandlePlayerListCommand( Split, Player )
	local World = Player:GetWorld()
	local PlayerList = World:GetAllPlayers()

	local Message = cChatColor.Green .. "Connected players: (".. cChatColor.White.. #PlayerList .. cChatColor.Green .. ")"
	Player:SendMessage( Message )

	local PlayerTable = {}
	for i, TempPlayer in ipairs( PlayerList ) do
		local PlayerName = TempPlayer:GetName()
		table.insert(PlayerTable, PlayerName )
	end

	Player:SendMessage( table.concat(PlayerTable, " ") )
	return true
end