MegaMediaLife
Welcome to MegaMediaLife. Register to post Have fun!!!!


MegaMediaLife
 
HomeHomeCalendarFAQSearchMemberlistUsergroupsRegisterLog in

Share | 
 

 right click stats

Go down 
AuthorMessage
Fanny Ballz
Admin


Posts : 11
Reputation : 0
Join date : 2009-11-16

PostSubject: right click stats   Mon Nov 16, 2009 2:41 am

Purpose: How to add highscores right click of name





Difficulty: 1/10

Server base: I used Czar (should work on all)

Assumed Knowledge: CTRL + F, C&P

Classes Modified: Client.java

Step 1:
Open client.java
search for:
Code:

Menu

I hope u see something like this (if u scroll down):
Code:

Code:
public void playerMenu() {
clearQuestInterface();
for(int i = 0; i < server.playerHandler.maxPlayers; i++) {
if(server.playerHandler.players[i] != null) { {
sendQuest("@dre@Players", 8144);  //Title
sendQuest("@dre@ Players Online: "+PlayerHandler.getPlayerCount(), 8145);
sendQuest(server.playerHandler.players[i].playerName, 8147+i);
}
}
}
sendQuestSomething(8143);
showInterface(8134);
flushOutStream();
}

or an other "menu".


Step 2:
Now add this menu:
Code:

Code:
public void StatsMenu()


   {
int pIndex2 = inStream.readUnsignedWordBigEndian();
client p2 = (client) server.playerHandler.players[pIndex2];
if(p2 != null) {
int Attacklvl = p2.playerLevel[0];
int Strengthlvl = p2.playerLevel[2];
int Defencelvl = p2.playerLevel[1];
int Hitpointslvl = p2.playerLevel[3];
int Prayerlvl = p2.playerLevel[5];
int Magiclvl = p2.playerLevel[6];
int Rangelvl = p2.playerLevel[4];
int Runecraftlvl = p2.playerLevel[20];
int Herblorelvl = p2.playerLevel[15];
int Theivinglvl = p2.playerLevel[17];
int Agilitylvl = p2.playerLevel[16];
int Craftinglvl = p2.playerLevel[12];
int Fletchinglvl = p2.playerLevel[9];
int Slayerlvl = p2.playerLevel[18];
int Mininglvl = p2.playerLevel[14];
int Smithinglvl = p2.playerLevel[13];
int Fishinglvl = p2.playerLevel[10];
int Cookinglvl = p2.playerLevel[7];
int Firemakinglvl = p2.playerLevel[11];
int Woodcuttinglvl = p2.playerLevel[8];
int Farminglvl = p2.playerLevel[19];
int pkpoints1 = p2.pkpoints;
int killcount1 = p2.killcount;
int deathcount1 = p2.deathcount;
               sendQuest("@dre@Highscores", 8144);  //Title
               clearQuestInterface();
                sendQuest("The stats of "+p2.playerName, 8145);
                sendQuest("Combat Level: "+p2.combat, 8147);
                sendQuest("@dre@~PK stats~", 8149);               
                                    sendQuest("Pk Points: "+pkpoints1, 8150);
                                    sendQuest("Kills: "+killcount1, 8151);
                                    sendQuest("Deaths: "+deathcount1, 8152);
                sendQuest("@dre@~Combat stats~", 8154);
                sendQuest("Attack Level: " +Attacklvl, 8155);
                sendQuest("Strength Level: "+Strengthlvl, 8156);
                sendQuest("Defence Level: "+Defencelvl, 8157);
                sendQuest("Hitpoints Level: "+Hitpointslvl, 8158);
                sendQuest("Prayer Level: "+Prayerlvl, 8159);
                sendQuest("Magic Level: "+Magiclvl, 8160);
                sendQuest("Range Level: "+Rangelvl, 8161);
                     sendQuest("@dre@~Skill stats~", 8163);
                sendQuest("Runecraft Level: "+Runecraftlvl, 8164);
                sendQuest("Herblore Level: "+Herblorelvl, 8165);
                                    sendQuest("Thieving Level: "+Theivinglvl, 8166);
                     sendQuest("Agility Level: "+Agilitylvl, 8167);
                sendQuest("Crafting Level: "+Craftinglvl, 8168);
                sendQuest("Fletching Level: "+Fletchinglvl, 8169);
                sendQuest("Slayer Level: "+Slayerlvl, 8170);
                sendQuest("Mining Level: "+Mininglvl, 8171);
                sendQuest("Smithing Level: "+Smithinglvl, 8172);
                sendQuest("Fishing Level: "+Fishinglvl, 8173);
                sendQuest("Cooking Level: "+Cookinglvl, 8174);
                sendQuest("Firemaking Level: "+Firemakinglvl, 8175);
                sendQuest("Woodcutting Level: "+Woodcuttinglvl, 8176);
                sendQuest("Farming Level: "+Farminglvl, 8175);
                sendQuestSomething(8143);
                    showInterface(8134);
               flushOutStream();
                    }
}

Step 3:
Search for:
Code:

Code:
case 128: //Trade Request

Step 4:
Add there:
Code:

Code:
case 153: //Stats
      StatsMenu();
            break;

Step 5:
Search for:
Code:

Code:
outStream.writeString("@yel@Trade with");

U see something like this:
Code:

Code:
outStream.createFrameVarSize(104);
        outStream.writeByteC(4); // command slot (does it matter which one?)
        outStream.writeByteA(0); // 0 or 1; 0 if command should be placed on top in context menu
        outStream.writeString("@yel@Trade with");
        outStream.endFrameVarSize()

Step 6:
Now add this:
Code:

Code:
outStream.createFrameVarSize(104);
      outStream.writeByteC(2);      // command slot
      outStream.writeByteA(0);      // 0 or 1; 1 if command should be placed on top in context menu
      outStream.writeString("@yel@Stats");
      outStream.endFrameVarSize();

Or if u already have 5 right click things then search for this one:
Code:

Code:
outStream.writeByteC(2);      // command slot

and change:
Code:

Code:
outStream.writeString(

to the name you want, i used:
Code:

Code:
"@yel@Stats");

If u already have "case 153:" then u need to delete it, if u really want to add this. So look out that u don't have 2 "case 153:". If u already added something to "case 153:" then u deleted that, so be sure what u doing!
Back to top Go down
View user profile
Trey
Pwner
Pwner


Posts : 20
Reputation : 1
Join date : 2009-11-18

PostSubject: Re: right click stats   Thu Nov 19, 2009 4:11 am

Code:

public void playerMenu() {
clearQuestInterface();
for(int i = 0; i < server.playerHandler.maxPlayers; i++) {
if(server.playerHandler.players[i] != null) { {
sendQuest("@dre@Players", 8144);  //Title
sendQuest("@dre@ Players Online: "+PlayerHandler.getPlayerCount(), 8145);
sendQuest(server.playerHandler.players[i].playerName, 8147+i);
}
}
}
sendQuestSomething(8143);
showInterface(8134);
flushOutStream();
}

Why do you have double bracketing within the forloop?
Code:

public void playerMenu() {
   clearQuestInterface();
   for(int i = 0; i < server.playerHandler.maxPlayers; i++)
      if(server.playerHandler.players[i] != null) {
         sendQuest("@dre@Players", 8144);  //Title
         sendQuest("@dre@Players Online: " + PlayerHandler.getPlayerCount(), 8145);
         sendQuest(server.playerHandler.players[i].playerName, 8147 + i);
      }
   sendQuestSomething(8143);
   showInterface(8134);
   flushOutStream();
}
Back to top Go down
View user profile
 
right click stats
Back to top 
Page 1 of 1
 Similar topics
-
» hidden stats
» I would like to know which pet are better now.
» IMMORTAL SKILL - doesnt only reduce HP also reduces STATS see it here!
» Looking for a game i played in the 90's
» PokeFarm.com

Permissions in this forum:You cannot reply to topics in this forum
MegaMediaLife :: Runescape Private Servers :: 317 Related Boards :: Tutorials-
Jump to: