Thread: Need Help Compiler Error.

Results 1 to 5 of 5
  1. #1 Need Help Compiler Error. 
    Extreme Donator

    Join Date
    Aug 2014
    Posts
    448
    Thanks given
    74
    Thanks received
    80
    Rep Power
    0
    Hi working on my Prestige command and keep getting this Error and wondering if someone could be of assistance. Thank you.


    Code:
    if (playerCommand.equalsIgnoreCase("prestige")) {
        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; ++ && c.prestigeLevel >= 10) {
        c.sendMessage("You have reached the maximum prestige level");
        } else {      
        int level = c.getLevelForXP(c.playerXP[i]);
    if(level < 99){
            c.sendMessage("You need 99 in all combat skills to prestiege!");
            } else {
                    c.playerLevel[i] = 1;
                    c.playerXP[i] = c.getPA().getXPForLevel(0);
                    c.getPA().refreshSkill(i);
                    }
            }
    }
            c.prestigeLevel += 1;
            c.prestigePoints += 5;
            c.getPA().requestUpdates();

    Reply With Quote  
     

  2. #2  
    Registered Member
    Zivik's Avatar
    Join Date
    Oct 2007
    Age
    28
    Posts
    4,421
    Thanks given
    891
    Thanks received
    1,527
    Rep Power
    3285
    Lol well I see what your trying to do just going about it wrong. Try this.

    Code:
    	if (playerCommand.equalsIgnoreCase("prestige")) {
    		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;
    			}
    		}      
    		if (c.prestigeLevel >= 10) {
    			c.sendMessage("You have reached the max prestige!");
    			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 prestige!");
                                    break;
    			}
    		}
                    for (int i = 0; i < 24; i++) {
    				c.playerLevel[i] = 1;
    				c.playerXP[i] = c.getPA().getXPForLevel(0);
    				c.getPA().refreshSkill(i);
                  }
    	}
    	c.prestigeLevel += 1;
    	c.prestigePoints += 5;
    	c.getPA().requestUpdates();
    Reply With Quote  
     

  3. #3  
    Extreme Donator

    Join Date
    Aug 2014
    Posts
    448
    Thanks given
    74
    Thanks received
    80
    Rep Power
    0
    that didnt quite work but i fixed it some other way but now when i type ":restige" i am able to prestige repeatidly without requirements.The requirements should be all 24 99's and after prestige your stats reset. I need it to reset stats and give player 5 prestige points and 1 prestige level.

    Code:
    if (playerCommand.equalsIgnoreCase("Prestige")) {
        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++) {
                            if (c.prestigeLevel >= 10) {
                            c.sendMessage("You have reached the maximum prestige level");
                                    } else {           
        int level = c.getLevelForXP(c.playerXP[i]);
    if(level < 99){
            c.sendMessage("You need 99 in all combat skills to prestiege!");
            } else {
                    c.playerLevel[i] = 1;
                    c.playerXP[i] = c.getPA().getXPForLevel(0);
                    c.getPA().refreshSkill(i);
                    }
            }
    }
            c.prestigeLevel += 1;
            c.prestigePoints += 5;
            c.getPA().requestUpdates();
    }
    Reply With Quote  
     

  4. #4  
    Extreme Donator

    Join Date
    Aug 2014
    Posts
    448
    Thanks given
    74
    Thanks received
    80
    Rep Power
    0
    bump
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Jun 2014
    Posts
    58
    Thanks given
    2
    Thanks received
    4
    Rep Power
    11
    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();
    }
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 2
    Last Post: 08-04-2014, 02:31 AM
  2. Need Some Help Compiler Error Please 614
    By Yourbad in forum Help
    Replies: 10
    Last Post: 12-22-2013, 11:01 PM
  3. [562]need help compile error[562)
    By xramunas12 in forum Help
    Replies: 12
    Last Post: 03-05-2010, 10:01 AM
  4. Java Help + Compiler Errors + highscores help
    By Silenced in forum Requests
    Replies: 6
    Last Post: 10-16-2008, 03:38 PM
  5. Need Help (Scripting Error)
    By Lovey in forum Chat
    Replies: 0
    Last Post: 05-24-2008, 05:03 PM
Tags for this Thread

View Tag Cloud

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •