Thread: Cannot be applied to boolean,int

Results 1 to 3 of 3
  1. #1 Cannot be applied to boolean,int 
    Donator


    Join Date
    Mar 2007
    Posts
    960
    Thanks given
    64
    Thanks received
    40
    Rep Power
    704
    Code:
    client.java:11110: operator || cannot be applied to boolean,int
    if(UsedOnObjectID == 9391 && ItemID == 1153 || 1115 || 1067){
                                                ^
    6 errors
    Finished!
    Press any key to continue . . .
    Here's the code:

    Code:
    if(UsedOnObjectID == 9391 && ItemID == 1153 || 1115 || 1067){
    if(playerHasItem(3706, 1)){
    server.npcHandler.spawnANPC(253, 3347, 3251, heightLevel);
    deleteItem(3706, 1);
    sM("You spawned a warrior!");
    setAnimation(811);
    } else
    sM("You must have 1 champions token!");
    }
    Reply With Quote  
     

  2. #2  
    Member

    Join Date
    Sep 2007
    Posts
    614
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    You have to do
    Code:
    if(UsedOnObjectID == 9391 && (ItemID == 1153 || ItemID == 1115 || ItemID == 1067)){
    Even without the extra parenthasees, you wouldnt get compile errors, but you would get logic errors, and things would be rather nasty when using items on objects.
    Reply With Quote  
     

  3. #3  
    Zak
    Zak is offline
    Donator


    Join Date
    Jul 2007
    Posts
    859
    Thanks given
    19
    Thanks received
    9
    Rep Power
    459
    hi......................

    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
  •