1. Hello

    Anyone have a plugin PlayersList to look like:


    ====Player list. Online:10====

    Nick, Nick, .....

    ======================


    i want this >> Online:10

    Thanks for help
     
  2. Wulf

    Wulf Community Admin

    Have you tried the existing player's list plugin? It wouldn't be hard to edit out the parts you do not want.
     
  3. I want that showed how many players on the server when someone will use the command /players
     
  4. Add something like this to the players list plugin

    Code:
    var playerSessions = GameManager.Instance.GetSessions();
    int count=0;foreach (var pair in playerSessions){ count++; }
    var headermsg = "==== Players List | Online: " + count + " ====";
    hurt.SendChatMessage(session, headermsg);
     
  5. You don't need to iterate through all the sessions just to get the player count.
    Use:
    Code:
    GameManager.Instance.GetPlayerCount();
    You could use something as simple as:
    Code:
    hurt.SendChatMessage(session, "Players online: "+GameManager.Instance.GetPlayerCount());
     
    Last edited by a moderator: Mar 25, 2016
  6. Thanks!
    Maybe now someone will help to change the color
    because it does not work > "<silver> Players online: <end>" <<
     
  7. Thanks mate. I knew there'd be a better way. I'm a c# noob :)
    [DOUBLEPOST=1458893144][/DOUBLEPOST]
    Code:
    "<color=silver> Players online: </color>" 
     
  8. Also you could just use
    .Count on any List. No need to loop at all :)
     
  9. Delete server and upload new files.