summaryrefslogtreecommitdiffstats
path: root/Core/playerlist.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Core/playerlist.lua')
-rw-r--r--Core/playerlist.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/Core/playerlist.lua b/Core/playerlist.lua
new file mode 100644
index 000000000..73d9e5b24
--- /dev/null
+++ b/Core/playerlist.lua
@@ -0,0 +1,14 @@
+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 \ No newline at end of file