well your code currently blocks you from setting any level above 6 already, so you cannot set slayer anyway, however if you want to be able to set those levels and only block certain ones then use this
Code:
if (playerCommand.startsWith("setlevel")) {
if (c.inWild())
return;
for (int j = 0; j < c.playerEquipment.length; j++) {
if (c.playerEquipment[j] > 0) {
c.sendMessage("Please take all your armour and weapons off before using this command.");
return;
}
}
try {
String[] args = playerCommand.split(" ");
int skill = Integer.parseInt(args[1]);
int level = Integer.parseInt(args[2]);
if (c.playerLevel[skill] == c.playerLevel[18]) {
c.sendMessage("You cannot set your slayer level");
return;
} else if (c.playerLevel[skill] == c.playerLevel[5]) {
c.sendMessage("You cannot set your prayer level");
return;
} else if (level > 99)
level = 99;
else if (level < 0)
level = 1;
c.playerXP[skill] = c.getPA().getXPForLevel(level)+5;
c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
c.getPA().refreshSkill(skill);
} catch (Exception e){}
}
otherwise if you want to block all levels above 6 AND prayer then use this
Code:
if (playerCommand.startsWith("setlevel")) {
if (c.inWild())
return;
for (int j = 0; j < c.playerEquipment.length; j++) {
if (c.playerEquipment[j] > 0) {
c.sendMessage("Please take all your armour and weapons off before using this command.");
return;
}
}
try {
String[] args = playerCommand.split(" ");
int skill = Integer.parseInt(args[1]);
int level = Integer.parseInt(args[2]);
if(skill > 6) {
c.sendMessage("You cant set this level");
return;
}
if (c.playerLevel[skill] == c.playerLevel[5]) {
c.sendMessage("You cannot set your prayer level");
return;
} else if (level > 99)
level = 99;
else if (level < 0)
level = 1;
c.playerXP[skill] = c.getPA().getXPForLevel(level)+5;
c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
c.getPA().refreshSkill(skill);
} catch (Exception e){}
}
hope this helps
any errors or problems then add my msn at [email protected]