diff options
Diffstat (limited to 'MCServer/Plugins/Core/playerlist.lua')
-rw-r--r-- | MCServer/Plugins/Core/playerlist.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/MCServer/Plugins/Core/playerlist.lua b/MCServer/Plugins/Core/playerlist.lua new file mode 100644 index 000000000..f06dfed85 --- /dev/null +++ b/MCServer/Plugins/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 |