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