Thread: Need Help with calling if skills are lower than 99

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 Need Help with calling if skills are lower than 99 
    Donator
    bigerman123's Avatar
    Join Date
    Feb 2011
    Age
    28
    Posts
    105
    Thanks given
    1
    Thanks received
    3
    Rep Power
    0
    Code:
    		case 245:
    			if(c.playerRights == 0 || c.playerRights == 5 || c.playerRights == 6 || c.playerRights == 7 || c.playerRights == 8 || c.playerRights == 10){
    				for (int i = 0; i < 22; i++) {
    					c.playerLevel[i] < 99;
    				}
    			c.sendMessage("Im sorry but you need to have 22/24 99's to be able to open this shop!");
    			
    			}else{
    				c.getShops().openShop(27);
    				c.sendMessage("Congratz!! you have no-lifed your ass to Max Cape!!");
    			}
    		break;
    This is my formula to try and make a shop open if you have 99s in skills 1 - 22. can you see why its giving me the error

    Code:
    src\server\model\players\ActionHandler.java:2765: not a statement
                                            c.playerLevel[i] < 99;
                                                             ^
    1 error
    Press any key to continue . . .
    Reply With Quote  
     

  2. #2  
    Super Donator

    Batukka's Avatar
    Join Date
    Oct 2011
    Posts
    2,433
    Thanks given
    86
    Thanks received
    342
    Rep Power
    496
    Code:
    	case 245:
    			for (int i = 0; i < 22; i++) {
    					if(c.playerLevel[i] < 99){
    				
    			c.sendMessage("Im sorry but you need to have 22/24 99's to be able to open this shop!");
    
    			}else{
    				c.getShops().openShop(27);
    				c.sendMessage("Congratz!! you have no-lifed your ass to Max Cape!!");
    			}
    }
    		break;
    Reply With Quote  
     

  3. #3  
    Donator
    bigerman123's Avatar
    Join Date
    Feb 2011
    Age
    28
    Posts
    105
    Thanks given
    1
    Thanks received
    3
    Rep Power
    0
    thanks ill see if it works.


    -----------------------------------------
    EDIT: Worked man thanks
    Reply With Quote  
     

  4. #4  
    Donator
    bigerman123's Avatar
    Join Date
    Feb 2011
    Age
    28
    Posts
    105
    Thanks given
    1
    Thanks received
    3
    Rep Power
    0
    Code:
    		case 245:
    			for (int i = 0; i < 22; i++) {
    				if(c.playerLevel[i] == 99){
    						c.getShops().openShop(27);
    							c.sendMessage("Congratz!! you have no-lifed your ass to Max Cape!!");
    
    			}else if(c.playerLevel[i] < 99){
    				c.sendMessage("Im sorry but you need to have 22/24 99's to be able to open this shop!");
    						}
    			}
    			break;
    the formula.

    and it doesnt stop people with out 99s in 22/24 skills from getting into the shop.
    Reply With Quote  
     

  5. #5  
    Boom Boom

    Kakapo's Avatar
    Join Date
    Aug 2010
    Posts
    1,030
    Thanks given
    358
    Thanks received
    218
    Rep Power
    365
    Code:
    	case 245:
    			for (int i = 0; i < 22; i++) {
    			if(c.playerLevel[i] < 99){
    			c.sendMessage("Im sorry but you need to have 22/24 99's to be able to open this shop!");
    			}
    			} else{
    				c.getShops().openShop(27);
    				c.sendMessage("Congratz!! you have no-lifed your ass to Max Cape!!");
    			}
    		break;
    try?


    Reply With Quote  
     

  6. #6  
    Donator
    bigerman123's Avatar
    Join Date
    Feb 2011
    Age
    28
    Posts
    105
    Thanks given
    1
    Thanks received
    3
    Rep Power
    0
    gives me this error:

    Code:
    src\server\model\players\ActionHandler.java:2767: 'else' without 'if'
                            } else{
                              ^
    1 error
    Press any key to continue . . .
    missing else if.. >.<
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Apr 2011
    Posts
    279
    Thanks given
    5
    Thanks received
    20
    Rep Power
    3
    Quote Originally Posted by bigerman123 View Post
    gives me this error:

    Code:
    src\server\model\players\ActionHandler.java:2767: 'else' without 'if'
                            } else{
                              ^
    1 error
    Press any key to continue . . .
    missing else if.. >.<
    No you aren't, you're closing the loop after the if which makes the else invalid.
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Apr 2011
    Posts
    279
    Thanks given
    5
    Thanks received
    20
    Rep Power
    3
    Code:
    		case 245:
    			int 99count;
    			if(c.playerRights == 0 || c.playerRights == 5 || c.playerRights == 6 || c.playerRights == 7 || c.playerRights == 8 || c.playerRights == 10) {
    				for (int i = 0; i < c.playerLevel.length; i++) {
    					if (c.playerLevel[i] == 99)
    						99count++;
    				}
    			}
    			if ((99count >= 22) || c.playerRights == 1 || c.playerRights == 2 || c.playerRights == 3 || c.playerRights == 4 || c.playerRights == 9) {
    				c.getShops().openShop(27);
    				c.sendMessage("Congratz!! you have no-lifed your ass to Max Cape!!"); //Message is gay, IMHO.
    				} else 
    				c.sendMessage("Im sorry but you need to have atleast 22 level 99 skills to be able to open this shop!");
    		break;
    Sorry for double post. This is the correct code.
    Reply With Quote  
     

  9. #9  
    Donator
    bigerman123's Avatar
    Join Date
    Feb 2011
    Age
    28
    Posts
    105
    Thanks given
    1
    Thanks received
    3
    Rep Power
    0
    lemme check it out
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Apr 2011
    Posts
    279
    Thanks given
    5
    Thanks received
    20
    Rep Power
    3
    Quote Originally Posted by bigerman123 View Post
    lemme check it out
    Tell me if there are any errors, I don't really do RSPS anymore.
    Just here to help with Java.
    Reply With Quote  
     

Page 1 of 2 12 LastLast

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: 5
    Last Post: 07-05-2011, 05:30 AM
  2. how can i make lower?
    By mr white in forum Help
    Replies: 0
    Last Post: 04-22-2010, 12:27 PM
  3. How would i lower my gfx's
    By Organic in forum Help
    Replies: 2
    Last Post: 04-18-2010, 10:32 PM
  4. Replies: 21
    Last Post: 12-06-2009, 06:24 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •