Jump to content
Sign in to follow this  
General

[PI] Ranks like loyalty programme [PI]

Recommended Posts

Well I'm going to tell you how to add the loyalty programme ranks and on right click also!

[B]Server Sided:[/B]

Go to Player.java and declare this:

[CODE]public int loyaltyRank;[/CODE]

now find playerProps.writeByte(combatLevel);

and replace [CODE]playerProps.writeWord(0);[/CODE] with:

[CODE]playerProps.writeWord(loyaltyRank);[/CODE]

Now save and exit and head to PlayerSave and add these in it (YOU SHOULD KNOW WHERE):

[CODE]} else if (token.equals("loyalty-rank")) {
p.loyaltyRank = Integer.parseInt(token2);[/CODE]

[CODE]characterfile.write("loyalty-rank = ", 0, 15);
characterfile.write(Integer.toString(p.loyaltyRank), 0, Integer
.toString(p.loyaltyRank).length());
characterfile.newLine();[/CODE]

Finished server sided

Now...

[B]Client Sided:[/B]

Declare this in client.java

[CODE]
//thanks to Nouish for getting the titles and me for programming.
public final String loyaltyRank(final int i) {
switch (i) {
case 1: return "Lord";
case 2: return "Lady";
case 3: return "Sir";
case 4: return "Dame";
case 5: return "Duderino";
case 6: return "Dudette";
case 7: return "Lionheart";
case 8: return "Crusader";
case 9: return "Hellraiser";
case 10: return "Desperado";
case 11: return "Baron";
case 12: return "Baroness";
case 13: return "Count";
case 14: return "Countess";
case 15: return "Overlord";
case 16: return "Overlordess";
case 17: return "Bandito";
case 18: return "Duke";
case 19: return "Duchess";
case 20: return "Big Cheese";
case 21: return "Bigwig";
case 22: return "King";
case 23: return "Queen";
case 24: return "Wunderkind";
default: return "";
}
}[/CODE]

now in the same class find

[CODE]private void buildAtPlayerMenu[/CODE]

and there should be [CODE]s = player.name + " (skill-" + player.skill + ")";[/CODE] after the else and replace that with:

[CODE]s = "@[email protected]" + loyaltyRank(player.skill) + "@[email protected] " + player.name
+ combatDiffColor(myPlayer.combatLevel, player.combatLevel)
+ " (level-" + player.combatLevel + ")";[/CODE]

Preview:

[img]http://i52.tinypic.com/314cyfb.jpg[/img]

Post errors.... Edited by General

Share this post


Link to post
Share on other sites
how does it show's on the chatbox

do you know that?. Edited by ARAZISCOOL
ss

Share this post


Link to post
Share on other sites
is there any way someone could help me over teamviewer cause i am brand new to coding and some people DON'T know where to add the files so it would be nice if you explained where.

Share this post


Link to post
Share on other sites
Yep, it's located in client.java :)

Share this post


Link to post
Share on other sites
[quote name='legacy508']Yep, it's located in client.java :)[/QUOTE]

Thats still doesnt helps me xD

Share this post


Link to post
Share on other sites
Sign in to follow this  

×