Thread: Ingame Highscores V2 With ranks (easy as pie)

Page 1 of 7 123 ... LastLast
Results 1 to 10 of 66
  1. #1 Ingame Highscores V2 With ranks (easy as pie) 
    Registered Member
    Bulby Strife's Avatar
    Join Date
    Jan 2008
    Age
    29
    Posts
    833
    Thanks given
    1
    Thanks received
    1
    Rep Power
    267
    Okay, this one is better than v1 because now it has ranks. V3 will have them in order.

    Still doesnot show ranks in order, and only shows of people logged in at the time.






    Difficulty: 1/10
    Classes Modified: Client.java/Server.java

    Lets get started!

    Step 1: Server.java

    Under this,
    Code:
    public static int cycleTime = 500;
    Add these
    Code:
    	public static int Rank1 = 0;
    	public static int Rank2 = 0;
    	public static int Rank3 = 0;
    	public static int Rank4 = 0;
    	public static int Rank5 = 0;
    	public static int Rank6 = 0;
    	public static int Rank7 = 0;
    	public static int Rank8 = 0;
    	public static int Rank9 = 0;
    	public static int Rank10 = 0;
    
    	public static int Rank11 = 0;
    	public static int Rank12 = 0;
    	public static int Rank13 = 0;
    	public static int Rank14 = 0;
    	public static int Rank15 = 0;
    	public static int Rank16 = 0;
    	public static int Rank17 = 0;
    	public static int Rank18 = 0;
    	public static int Rank19 = 0;
    	public static int Rank20 = 0;
    Done with server.java!

    Step 2: Client.java

    Add these voids

    Code:
    public void resetRanks()
    {
    server.Rank1 = 0;
    server.Rank2 = 0;
    server.Rank3 = 0;
    server.Rank4 = 0;
    server.Rank5 = 0;
    server.Rank6 = 0;
    server.Rank7 = 0;
    server.Rank8 = 0;
    server.Rank9 = 0;
    server.Rank10 = 0;
    server.Rank11 = 0;
    server.Rank12 = 0;
    server.Rank13 = 0;
    server.Rank14 = 0;
    server.Rank15 = 0;
    server.Rank16 = 0;
    server.Rank17 = 0;
    server.Rank18 = 0;
    server.Rank19 = 0;
    server.Rank20 = 0;
    }
    
    public void highscores() {
    clearQuestInterface();
    for(int i = 0; i < server.playerHandler.maxPlayers; i++) {
    if(server.playerHandler.players[i] != null) { {
    sendQuest("@[email protected]", 8144);  //Title
    sendQuest("@[email protected] ====Highscores====", 8145);
    sendQuest("@[email protected]"+server.playerHandler.players[i].playerName+ " =  @[email protected] Lvl:@[email protected] " +server.playerHandler.players[i].playerLevel[24]+ "@[email protected]   Rank @[email protected]"  +server.playerHandler.players[i].playerLevel[22], 8147+i);
    }
    }
    }
    sendQuestSomething(8143);
    showInterface(8134);
    flushOutStream();
    }
    
    public int playerRank = 0;
    Now search for

    Code:
    public boolean process() {
    and add this crap under it

    Code:
    playerLevel[24] = totalz;
    playerLevel[22] = playerRank;
    
    
    if(totalz >= server.Rank1)
    {
    playerRank = 1;
    server.Rank1 = totalz;
    }
    
    if(totalz >= server.Rank2 && totalz < server.Rank1)
    {
    playerRank = 2;
    server.Rank2 = totalz;
    }
    
    if(totalz >= server.Rank3 && totalz < server.Rank2)
    {
    playerRank = 3;
    server.Rank3 = totalz;
    }
    
    if(totalz >= server.Rank4 && totalz < server.Rank3)
    {
    playerRank = 4;
    server.Rank4 = totalz;
    }
    
    if(totalz >= server.Rank5 && totalz < server.Rank4)
    {
    playerRank = 5;
    server.Rank5 = totalz;
    }
    
    if(totalz >= server.Rank6 && totalz < server.Rank5)
    {
    playerRank = 6;
    server.Rank6 = totalz;
    }
    
    if(totalz >= server.Rank7 && totalz < server.Rank6)
    {
    playerRank = 7;
    server.Rank7 = totalz;
    }
    if(totalz >= server.Rank8 && totalz < server.Rank7)
    {
    playerRank = 8;
    server.Rank8 = totalz;
    }
    
    if(totalz >= server.Rank9 && totalz < server.Rank8)
    {
    playerRank = 9;
    server.Rank9 = totalz;
    }
    
    if(totalz >= server.Rank10 && totalz < server.Rank9)
    {
    playerRank = 10;
    server.Rank10 = totalz;
    }
    
    if(totalz >= server.Rank11 && totalz < server.Rank10)
    {
    playerRank = 11;
    server.Rank11 = totalz;
    }
    
    if(totalz >= server.Rank12 && totalz < server.Rank11)
    {
    playerRank = 12;
    server.Rank12 = totalz;
    }
    
    if(totalz >= server.Rank13 && totalz < server.Rank12)
    {
    playerRank = 13;
    server.Rank13 = totalz;
    }
    
    if(totalz >= server.Rank14 && totalz < server.Rank13)
    {
    playerRank = 14;
    server.Rank14 = totalz;
    }
    
    if(totalz >= server.Rank15 && totalz < server.Rank14)
    {
    playerRank = 15;
    server.Rank15 = totalz;
    }
    
    if(totalz >= server.Rank16 && totalz < server.Rank15)
    {
    playerRank = 16;
    server.Rank16 = totalz;
    }
    
    if(totalz >= server.Rank17 && totalz < server.Rank16)
    {
    playerRank = 17;
    server.Rank17 = totalz;
    }
    
    if(totalz >= server.Rank18 && totalz < server.Rank17)
    {
    playerRank = 18;
    server.Rank18 = totalz;
    }
    
    if(totalz >= server.Rank19 && totalz < server.Rank18)
    {
    playerRank = 19;
    server.Rank19 = totalz;
    }
    
    if(totalz >= server.Rank20 && totalz < server.Rank19)
    {
    playerRank = 20;
    server.Rank20 = totalz;
    }
    
    if(totalz < server.Rank20)
    {
    playerRank = 0;
    }

    almost done!

    Step 3:

    Search for

    Code:
    public void logout(){
    add this under it

    Code:
    resetRanks();
    also add with your login screen or login welcome message.

    Example:

    Code:
    sendMessage("Welcome to Trunescape!");
    resetRanks();
    And thats it! :woot: It shows top 20 players


    To make the board open the highscores search for

    Code:
    case 132:
    add this under there

    Code:
    if(objectID == 3192)
    {
    highscores();
    }
    Now if you dont know how to add global objects, umm try this command

    Code:
    	if (command.equalsIgnoreCase("highscores"))
    {
    highscores(); 
    }
    add that with the rest of your commands.



    Enjoy!
    Post any errors you get! Rep+ would be nice...
    [Only registered and activated users can see links. ]
    ||||||||||||||||||||||||||||||

     

  2. #2  
    Extreme Donator


    Join Date
    Nov 2007
    Posts
    2,712
    Thanks given
    47
    Thanks received
    9
    Rep Power
    650
    nice! but it would be nicer if it shode there actual combat lvl?
     

  3. #3  
    JavaNerd
    Guest
    Very nice again
     

  4. #4  
    pljay03
    Guest
    Now you're getting some where
     

  5. #5  
    Registered Member
    Join Date
    Jan 2008
    Posts
    105
    Thanks given
    0
    Thanks received
    0
    Rep Power
    2
    22 Errors
    Starts like this
    Client.java:14741: cannot find symbol
    symbol : Variable playerRank
    location: class client
    playerLevel[22] = playerRank;

    then
    Client.java:14741: cannot find symbol
    symbol : Variable playerRank
    location: class client
    playerRank = 1;

    keeps going down to PlayerRank 20
    Help =(

    client.
     

  6. #6  
    LittleTodds
    Guest
    I am having the same problem as Durent.

    Am I putting the stuff in server.java in the right spot?

    Code:
    	// TODO: yet to figure out proper value for timing, but 500 seems good
    	public static final int cycleTime = 500;
    
    
    	public static int Rank1 = 0;
    	public static int Rank2 = 0;
    	public static int Rank3 = 0;
    	public static int Rank4 = 0;
    	public static int Rank5 = 0;
    	public static int Rank6 = 0;
    	public static int Rank7 = 0;
    	public static int Rank8 = 0;
    	public static int Rank9 = 0;
    
    	public static int Rank10 = 0;
    	public static int Rank11 = 0;
    	public static int Rank12 = 0;
    	public static int Rank13 = 0;
    	public static int Rank14 = 0;
    	public static int Rank15 = 0;
    	public static int Rank16 = 0;
    	public static int Rank17 = 0;
    	public static int Rank18 = 0;
    	public static int Rank19 = 0;
    	public static int Rank20 = 0;
    
    	public static int playerRank = 0;
    
    	public static boolean updateServer = false;
    	public static int updateSeconds = 180; //180 because it doesnt make the time jump at the start :P
    
    	public static long startTime;
     

  7. #7  
    Member
    Nour's Avatar
    Join Date
    May 2007
    Posts
    472
    Thanks given
    127
    Thanks received
    61
    Rep Power
    569
    Arrays where made for a reason mate, instead of
    public static int Rank1 = 0;
    public static int Rank2 = 0;
    public static int Rank3 = 0;
    public static int Rank4 = 0;
    public static int Rank5 = 0;
    public static int Rank6 = 0;
    public static int Rank7 = 0;
    public static int Rank8 = 0;
    public static int Rank9 = 0;
    public static int Rank10 = 0;

    public static int Rank11 = 0;
    public static int Rank12 = 0;
    public static int Rank13 = 0;
    public static int Rank14 = 0;
    public static int Rank15 = 0;
    public static int Rank16 = 0;
    public static int Rank17 = 0;
    public static int Rank18 = 0;
    public static int Rank19 = 0;
    public static int Rank20 = 0;

    use public static int Ranks[] = new int[19];
    RIP Emps-scape 2006-2013.
    [SPOIL]
    [/SPOIL]

    i need 2 herd sum bots
    i need 2 steal sum zombies
    i need 2 open many slots
    to hold my ****in zombies
     

  8. #8  
    Registered Member
    Join Date
    Jan 2008
    Posts
    105
    Thanks given
    0
    Thanks received
    0
    Rep Power
    2
    I really don't see how this code even works, I mean if u look at it,
    It doesn't even delcare that the object number 3192 (which is highscore board)
    Will be used to setup the whole highscore process .
     

  9. #9  
    Registered Member Phiction's Avatar
    Join Date
    Dec 2006
    Age
    28
    Posts
    253
    Thanks given
    13
    Thanks received
    2
    Rep Power
    31
    Since it only shows the people that are online, maybe change where it says Highscores, it could be like a "Who's Online" board thing? lol idk, I guess that's what I'll do

    Other than that, this is really nice. I've been trying to work out something like this for a while now
    [Only registered and activated users can see links. ]
     

  10. #10  
    Icy Realm Owner
    Icy Whip's Avatar
    Join Date
    May 2007
    Posts
    1,419
    Thanks given
    30
    Thanks received
    35
    Rep Power
    213
    how do i make it so when you click on scoreboard it works what i add under that?
    [Only registered and activated users can see links. ]

    Signature made by Mr. Ervis

    Any questions, MSN me; [Only registered and activated users can see links. ]
     

Page 1 of 7 123 ... LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •