Thread: [667] ::players showing the highest player count online today

Results 1 to 4 of 4
  1. #1 [667] ::players showing the highest player count online today 
    Registered Member
    Join Date
    Aug 2011
    Posts
    247
    Thanks given
    0
    Thanks received
    4
    Rep Power
    11
    How can i add a 667 command :: players that tells you how many are online and the highest amount of players online at one time today? Thanks. Much appreciated - a thanks and rep to whoever helps me.
    Reply With Quote  
     

  2. #2  
    L O S E Y O U R S E L F
    Format's Avatar
    Join Date
    Aug 2013
    Posts
    2,311
    Thanks given
    1,131
    Thanks received
    1,461
    Rep Power
    5000
    Code:
    private int currentPlayers;
    private int maxPlayers;
    
    if (currentPlayers > maxPlayers) {
           maxPlayers = currentPlayers;
    }


    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Dec 2012
    Posts
    2,999
    Thanks given
    894
    Thanks received
    921
    Rep Power
    2555
    Declare this in either your Server or World class:
    Code:
    private static int highestOnline;
    
    public static void setHighestOnline(int highestOnline) {
    this.highestOnline = highestOnline;
    }
    
    public static int getHighestOnline() {
    return highestOnline;
    }
    Upon a player registering into the world:
    Code:
    if (players.size() < highestOnline) 
    highestOnline = players.size();
    To display this information:
    Code:
    System.out.println(String.format("The highest amount of players online simultaneously is %i", highestOnline));
    Attached image
    Reply With Quote  
     

  4. #4  
    Everybody needs a bosom for a pillow
    Hyperon's Avatar
    Join Date
    Nov 2014
    Age
    34
    Posts
    108
    Thanks given
    18
    Thanks received
    22
    Rep Power
    11
    Quote Originally Posted by Kaleem View Post
    Code:
    if (players.size() > highestOnline) 
    highestOnline = players.size();
    Fixed.
    RS: DayZ Mod development
    For the best old school vibe #289: http://classic-live.net/
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [PI]::Players showing list of players
    By Zenocko in forum Snippets
    Replies: 29
    Last Post: 07-16-2015, 12:20 PM
  2. How to find the highest skill of a player
    By Tringan in forum Snippets
    Replies: 14
    Last Post: 02-22-2013, 03:56 PM
  3. ::players shows whose online
    By Chatter in forum Help
    Replies: 5
    Last Post: 07-24-2012, 05:20 AM
  4. Replies: 24
    Last Post: 05-17-2012, 10:34 PM
  5. Spining player from the design player interface
    By Clienthax in forum Tutorials
    Replies: 5
    Last Post: 05-27-2008, 01:12 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •