You have to use return when a requirement is not met.
Code:
if (playerCommand.equalsIgnoreCase("Prestige")) {
if(c.prestigeLevel >= 10) { //place this here, no need to loop it
c.sendMessage("You have reached the maximum prestige level");
return;
}
for (int j = 0; j < c.playerEquipment.length; j++) {
if (c.playerEquipment[j] > 1) {
c.sendMessage("Take off your items first! Make sure your combat level is maxed");
return;
}
}
for (int i = 0; i < 24; i++) {
int level = c.getLevelForXP(c.playerXP[i]);
if(level < 99){
c.sendMessage("You need 99 in all combat skills to prestiege!");
return;
}
c.playerLevel[i] = 1;
c.playerXP[i] = c.getPA().getXPForLevel(0);
c.getPA().refreshSkill(i);
}
c.prestigeLevel += 1;
c.prestigePoints += 5;
c.getPA().requestUpdates();
}