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]
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 : Then Add
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 : Add This :
Under 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
Finished Any Problems and if I missed anything Just post below
~ Adam