Thread: Item on Item error

Results 1 to 3 of 3
  1. #1 Item on Item error 
    Registered Member pk3r john's Avatar
    Join Date
    Apr 2009
    Posts
    877
    Thanks given
    16
    Thanks received
    30
    Rep Power
    63
    I get this error when compiling:
    Code:
    client.java:25044: 'else' without 'if'
        else if((itemUsed == 227 && useWith == 221)) { // vow with eye of newt
        ^
    1 error
    Press any key to continue . . .
    and this is my code:

    Code:
        public boolean CheckForSkillUse() { // Use Item On Item
    
        else if((itemUsed == 227 && useWith == 221)) { // vow with eye of newt
    sM("You make an attack potion.");
    deleteItem(221, getItemSlot(221), 1);
    addItem(2428, 1); // attack pot
    addSkillXP((500*playerLevel[17]), 17);
    }
        if((itemUsed == 227 && useWith == 225)) { // vow with limpwurt
    sM("You make a strength potion.");
    deleteItem(225, getItemSlot(225), 1);
    addItem(113, 1); // str pot
    addSkillXP((950*playerLevel[17]), 17);
    }
        if((itemUsed == 227 && useWith == 1951)) { // vow with redberries
    sM("You make a defense potion.");
    deleteItem(1951, getItemSlot(1951), 1);
    addItem(2440, 1); // def pot
    addSkillXP((1350*playerLevel[17]), 17);
    }
        if((itemUsed == 227 && useWith == 239)) { // vow with whiteberries
    sM("You make a super attack potion.");
    deleteItem(239, getItemSlot(239), 1);
    addItem(2436, 1); // super att pot
    addSkillXP((3500*playerLevel[17]), 17);
    }
        if((itemUsed == 227 && useWith == 3369)) { // vow with thin snail meat
    sM("You make a super strength potion.");
    deleteItem(3369, getItemSlot(3369), 1);
    addItem(2440, 1); // super str pot
    addSkillXP((6000*playerLevel[17]), 17);
    }
        if((itemUsed == 227 && useWith == 4674)) { // vow with gilded cross
    sM("You make a Prayer Restore potion.");
    deleteItem(4674, getItemSlot(4674), 1);
    addItem(2434, 1); // pray pot
    addSkillXP((10000*playerLevel[17]), 17);
    }
    I couldn't find anything wrong with it.. help please?
    Reply With Quote  
     

  2. #2  
    haloking
    Guest
    First off you don't need the else.... and Your going to need to add another bracket in the end, you should have 2 right there. If you don't already.
    Reply With Quote  
     

  3. #3  
    Registered Member pk3r john's Avatar
    Join Date
    Apr 2009
    Posts
    877
    Thanks given
    16
    Thanks received
    30
    Rep Power
    63
    Quote Originally Posted by haloking View Post
    First off you don't need the else.... and Your going to need to add another bracket in the end, you should have 2 right there. If you don't already.
    100 errors
    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

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