Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
List players online
  • Loading branch information
N1Ran committed Feb 9, 2019
commit 514ea6e30e11e0c6c18e59bd00ef202ee0868c83
18 changes: 18 additions & 0 deletions Essentials/Commands/AdminModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ public void PlayerCount(int count = -1)
Context.Respond($"Max player count: {MyMultiplayer.Static.MemberLimit}. Current online players: {MyMultiplayer.Static.MemberCount - 1}");
}

[Command("playerlist", "Lists current players on the server")]
[Permission(MyPromoteLevel.Admin)]
public void ListPlayers()
{
if(MySession.Static.Players.GetOnlinePlayerCount() == 0)
{
Context.Respond("No players online");
return;
}
StringBuilder sb = new StringBuilder();
foreach(var player in MySession.Static.Players.GetOnlinePlayers())
{
sb.Append($"{player.DisplayName}, ");
}
Context.Respond(sb.ToString());
Comment thread
N1Ran marked this conversation as resolved.
Outdated
}


[Command("runauto", "Runs the auto command with the given name immediately")]
[Permission(MyPromoteLevel.Admin)]
public void RunAuto(string name)
Expand Down