Thread: [PI] Adding Kill/Death Ratio

Page 1 of 14 12311 ... LastLast
Results 1 to 10 of 134
  1. #1 [PI] Adding Kill/Death Ratio 
    Highly Regarded Member

    Lenin's Avatar
    Join Date
    Nov 2008
    Age
    26
    Posts
    1,885
    Thanks given
    526
    Thanks received
    218
    Rep Power
    2434
    Well Just moved from 500+ Servers felt like giving something back it is small but I will probably give better stuff I didn't find it posted already so quick tutorial .

    Purpose: KDR For Pking
    Difficulty: 1/10
    Assumed Knowledge: Copy & Pasting
    Classes Modified: PlayerSave.java, Player.java, PlayerAssistant.java & Commands.java
    Tested On: Final Client - Server [Idk think thats the name]

    Spoiler for Kill/Death Ratio Image:


    Step 1 : Adding KDR Command - Commands.java

    Code:
    			if (playerCommand.startsWith("kdr")) {
    				double KDR = ((double)c.KC)/((double)c.DC);
    				c.forcedChat("My Kill/Death ratio is "+c.KC+"/"+c.DC+"; "+KDR+".");
    			}
    Step 2 : Declaring KC & DC - Player.java

    Find :
    Code:
    public int
    Then Add

    Code:
    KC,
    DC,
    Step 3 : Adding Saving Stuff - PlayerSave.java

    Search case 2: and Add stuff below

    Code:
    } else if (line.startsWith("KC")) {
    	p.KC = Integer.parseInt(token2);
    } else if (line.startsWith("DC")) {
    	p.DC = Integer.parseInt(token2);
    Step 4 : Still In PlayerSave.java

    Put This In the saveGame boolean In character part

    Code:
    characterfile.write("KC = ", 0, 4);
    characterfile.write(Integer.toString(p.KC), 0, Integer.toString(p.KC).length());
    characterfile.newLine();
    characterfile.write("DC = ", 0, 4);
    characterfile.write(Integer.toString(p.DC), 0, Integer.toString(p.DC).length());
    characterfile.newLine();

    Step 5 : Finally go to PlayerAssistant.java


    Find :
    Code:
    applyDead()
    Add This :

    Code:
    c.DC++;
    o.KC++;
    Under
    Code:
    if(o != null) {
    Make Sure You Have This Somewhere in the Method should be there already -
    Code:
    Client o = (Client) Server.playerHandler.players[c.killerId];

    Step 6 : Compile & Run


    Spoiler for Kill/Death Ratio Image:



    Finished Any Problems and if I missed anything Just post below

    ~ Adam
    Extreme Donator

    "It ain't what you don't know that gets you into trouble. It's what you know for sure that just ain't so."
    Reply With Quote  
     

  2. #2  
    Highly Regarded Member

    Lenin's Avatar
    Join Date
    Nov 2008
    Age
    26
    Posts
    1,885
    Thanks given
    526
    Thanks received
    218
    Rep Power
    2434
    No Comments
    Extreme Donator

    "It ain't what you don't know that gets you into trouble. It's what you know for sure that just ain't so."
    Reply With Quote  
     

  3. #3  
    If you read this you're gay!
    Infexis's Avatar
    Join Date
    Aug 2009
    Age
    25
    Posts
    4,561
    Thanks given
    1,158
    Thanks received
    1,173
    Rep Power
    2949
    Looking good, a picture would be great to see how it looks like
    [Only registered and activated users can see links. ]
    "If you can't explain it simply, you don't understand it well enough." - Albert Einstein
    Reply With Quote  
     

  4. #4  
    Registered Member
    Gator God's Avatar
    Join Date
    Aug 2010
    Posts
    260
    Thanks given
    15
    Thanks received
    26
    Rep Power
    99
    Nice guide
    Quote Originally Posted by H A W X;
    [IMG]C:\Users\R\Desktop\Rune-Server\Pictures[/IMG]
    :trollface:
    Reply With Quote  
     

  5. #5  
    Highly Regarded Member

    Lenin's Avatar
    Join Date
    Nov 2008
    Age
    26
    Posts
    1,885
    Thanks given
    526
    Thanks received
    218
    Rep Power
    2434
    Thank You Added Image So People Can See What It Is
    Extreme Donator

    "It ain't what you don't know that gets you into trouble. It's what you know for sure that just ain't so."
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    May 2010
    Posts
    217
    Thanks given
    0
    Thanks received
    2
    Rep Power
    1
    the math hurts my head! gj
    Reply With Quote  
     

  7. #7  
    Registered Member
    Gator God's Avatar
    Join Date
    Aug 2010
    Posts
    260
    Thanks given
    15
    Thanks received
    26
    Rep Power
    99
    I was actually trying to figure out the formula for K/D ratio the other day.
    Quote Originally Posted by H A W X;
    [IMG]C:\Users\R\Desktop\Rune-Server\Pictures[/IMG]
    :trollface:
    Reply With Quote  
     

  8. #8  
    Registered Member

    Join Date
    Feb 2010
    Age
    14
    Posts
    1,262
    Thanks given
    554
    Thanks received
    403
    Rep Power
    832
    Like this actually takes any effort?
    Reply With Quote  
     

  9. #9  
    Banned

    Join Date
    Oct 2009
    Age
    26
    Posts
    1,579
    Thanks given
    4
    Thanks received
    23
    Rep Power
    0
    Coolo.
    Reply With Quote  
     

  10. #10  
    Highly Regarded Member

    Lenin's Avatar
    Join Date
    Nov 2008
    Age
    26
    Posts
    1,885
    Thanks given
    526
    Thanks received
    218
    Rep Power
    2434
    I said it was little you noob not much people had it so I thought I should post
    Extreme Donator

    "It ain't what you don't know that gets you into trouble. It's what you know for sure that just ain't so."
    Reply With Quote  
     

Page 1 of 14 12311 ... 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
  •