Jump to content
  • 0
wasolsdpker

Announcing to server Error

Question

I need help im getting an error im trying to make it so it announces to server when someone gets 99 in a skill

[QUOTE] public void levelUp(int skill) {
c.inDialogue = true;
updateSkillTab();
switch(skill) {
case 0:
sendFrame126("Congratulations, you just advanced an attack level!", 6248);
sendFrame126("Your attack level is now "+c.realLevel[skill]+".", 6249);
c.sendMessage("Congratulations, you just advanced an attack level.");
c.getPA().sendFrame126("Combat Level: "+c.getCombatLevel()+"", 3983);
sendFrame164(6247);
if(c.playerLevel[0] <= 99 ) {
c2.sendMessage("<shad=15695415>[Ruination News]:" + c.playerName + " " + " has achieved 99 in.</col> ");
}
}
}


break;[/QUOTE]

Share this post


Link to post
Share on other sites

11 answers to this question

Recommended Posts

  • 0
[quote name='fallen2dc']I need help im getting an error im trying to make it so it announces to server when someone gets 99 in a skill[/QUOTE]

can you post the error?

Share this post


Link to post
Share on other sites
  • 0
[quote name='StevenAbraham']can you post the error?[/QUOTE]

over 100

Share this post


Link to post
Share on other sites
  • 0
[quote name='fallen2dc']I need help im getting an error im trying to make it so it announces to server when someone gets 99 in a skill[/QUOTE]

Your brackets are all wrong.

Share this post


Link to post
Share on other sites
  • 0
[quote name='fallen2dc']I need help im getting an error im trying to make it so it announces to server when someone gets 99 in a skill[/QUOTE]

I'm assuming your using PI so... if you get any errors post them.

In player assistant find

[code]public void levelUp(int skill) {[/code]

Then replace it with

[code]
public static final String[] SKILL_NAME = {"Attack", "Defence",
"Strength", "Hitpoints", "Range", "Prayer",
"Magic", "Cooking", "Woodcutting", "Fletching",
"Fishing", "Firemaking", "Crafting", "Smithing",
"Mining", "Herblore", "Agility", "Thieving",
"Slayer", "Farming", "Runecrafting"};

public void levelUp(int skill) {
for (int i = 0; skill < 20; i++) {
int totalLevel = getLevelForXP(c.playerXP[i]);
sendFrame126("Total Lvl: " + totalLevel, 3984);
}
sendFrame126("Congratulations, you just advanced an " + SKILL_NAME[skill] + " level!", 6248);
sendFrame126("Your attack level is now " + getLevelForXP(c.playerXP[skill]) + ".", 6249);
c.sendMessage("Congratulations, you just advanced an " + SKILL_NAME[skill] + " level.");
sendFrame164(6247);
if (getLevelForXP(c.playerXP[skill]) == 99) {
for (int j = 0; j < Server.playerHandler.players.length; j++) {
if (Server.playerHandler.players[j] != null) {
Client c2 = (Client) Server.playerHandler.players[j];
c2.sendClan("SERVER", c.playerName + " just advanced to " + getLevelForXP(c.playerXP[skill]) + " " + SKILL_NAME[skill] + "!", "Global Chat", 2);
}
}

}
}[/code]

Share this post


Link to post
Share on other sites
  • 0
[quote name='Chronicscape']then post it[/QUOTE]

[img]http://i.gyazo.com/c3c1b8b87ffd7f47044c771f5d795278.png[/img]

Share this post


Link to post
Share on other sites
  • 0
Why does it appear your method is inside a switch statement?

Share this post


Link to post
Share on other sites
  • 0
[quote name='fallen2dc'][img]http://i.gyazo.com/c3c1b8b87ffd7f47044c771f5d795278.png[/img][/QUOTE]

missing a [CODE]break;[/CODE] in there somewhere :) / removal

Share this post


Link to post
Share on other sites
  • 0
[quote name='Chronicscape']missing a [CODE]break;[/CODE] in there somewhere :) / removal[/QUOTE]

I got it to work

[QUOTE] case 0:
sendFrame126("Congratulations, you just advanced an attack level!", 6248);
sendFrame126("Your attack level is now "+c.realLevel[skill]+".", 6249);
c.sendMessage("Congratulations, you just advanced an attack level.");
c.getPA().sendFrame126("Combat Level: "+c.getCombatLevel()+"", 3983);
sendFrame164(6247);
}
if(getLevelForXP(c.playerXP[0]) == 99) {
c.sendMessage("<shad=15695415>[Ruination News]:" + c.playerName + " " + " has achieved 99 in attack.</col> ");
c.inDialogue = true;
updateSkillTab();
switch(skill) {[/QUOTE]

But when someone gets 99 in one stat it announces they got in all..

i got 99 attack =

[img]http://i.gyazo.com/bcc16cabf6db39d75d03d7ff7912edca.png[/img]

Share this post


Link to post
Share on other sites

×