Thread: [PI] Donator shop problem

Results 1 to 8 of 8
  1. #1 [PI] Donator shop problem 
    Trolling Zanix's Avatar
    Join Date
    Dec 2011
    Posts
    346
    Thanks given
    28
    Thanks received
    14
    Rep Power
    18
    Hey guys, this is going to sound noob as hell but how the hell do I add this?

    Code:
    		case 121129:
    		if(c.playerRights == 4)
    		c.getShops().openShop(19);
    		} else { 
    		if(c.playerRights == 0)
    		c.sendMessage("<img=0>You must be a Donator to do this");
    		break;
    I know it goes in clicking buttons but I get these errors

    Code:
    src\server\model\players\packets\ClickingButtons.java:3137: 'else' without 'if'
                    } else {
                      ^
    src\server\model\players\packets\ClickingButtons.java:3142: orphaned case
                    case 121133:
                    ^
    2 errors
    Press any key to continue . . .
    I normally can fix these but its been ages since I have done a case like this ><

    If someone can fix up my code that would be great, thanks!
    Reply With Quote  
     

  2. #2  
    GANGNAM STYLE!

    Ohad's Avatar
    Join Date
    Aug 2011
    Posts
    3,179
    Thanks given
    152
    Thanks received
    352
    Rep Power
    1671
    i believe it should be in actionhandler.java
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Trolling Zanix's Avatar
    Join Date
    Dec 2011
    Posts
    346
    Thanks given
    28
    Thanks received
    14
    Rep Power
    18
    But its a button case, I'm using an interface to open up the shop
    Reply With Quote  
     

  5. #4  
    Registered Member
    Join Date
    Jan 2012
    Posts
    58
    Thanks given
    0
    Thanks received
    3
    Rep Power
    22
    Try that
    Code:
    case 121129:
    		if(c.playerRights == 4)
    		c.getShops().openShop(19);
    		} else {
    		c.sendMessage("<img=0>You must be a Donator to do this");
    		break;

    Have I helped you? Don't post a thanks, there's a button for it.

    Reply With Quote  
     

  6. Thankful user:


  7. #5  
    Trolling Zanix's Avatar
    Join Date
    Dec 2011
    Posts
    346
    Thanks given
    28
    Thanks received
    14
    Rep Power
    18
    Neither of them worked, lol

    EDIT:haha, I'm such a noob xD I fixed it

    Code:
    		case 121129:
    		if(c.playerRights == 4) {
    		c.getShops().openShop(19);
    		} else {
    		//if (c.playerRights == 0)
    		c.sendMessage("<img=0>You must be a Regular Donator to do this");
    		}
    		break;
    Thanks guys for trying to help
    Reply With Quote  
     

  8. #6  
    Registered Member
    Join Date
    Jan 2012
    Posts
    58
    Thanks given
    0
    Thanks received
    3
    Rep Power
    22
    Weird, it worked on my server perfectly, try this one?
    Code:
    case 121129:
    		if(c.playerRights == 4)
    		c.getShops().openShop(19);
    		} else if {
    		c.sendMessage("<img=0>You must be a Donator to do this");
    		}
                    break;

    Have I helped you? Don't post a thanks, there's a button for it.

    Reply With Quote  
     

  9. #7  
    Registered Member
    Join Date
    Jan 2012
    Posts
    58
    Thanks given
    0
    Thanks received
    3
    Rep Power
    22
    You should try using } else if { instead of } else {
    It is a more efficient way of doing it.

    Have I helped you? Don't post a thanks, there's a button for it.

    Reply With Quote  
     

  10. #8  
    Extreme Donator


    Join Date
    Oct 2006
    Posts
    1,370
    Thanks given
    64
    Thanks received
    197
    Rep Power
    426
    Ijordan, what the fuck are you talking about?

    } else { basically means, if the first condition isn't true then just do this. } else if (x) { means if the first condition isnt true, check if this condition is true, etc.

    also else if statements always require a condition (} else if (c.playerName.equalsIgnoreCase("ijordan")) { for example)


    ~flow@hacking . rs
    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. Donator shop
    By Jazok in forum Help
    Replies: 0
    Last Post: 12-22-2011, 10:14 PM
  2. [PI] problem with donator shop
    By Kurdz in forum Help
    Replies: 2
    Last Post: 06-26-2011, 03:06 PM
  3. donator shop [pi]
    By artist in forum Help
    Replies: 0
    Last Post: 06-14-2011, 03:41 AM
  4. 614 shop buy problem from 2nd shop
    By Zᴀᴄʜ in forum Help
    Replies: 0
    Last Post: 04-14-2011, 11:03 PM
  5. Donator shop
    By Hatescape1 in forum Help
    Replies: 8
    Last Post: 04-19-2009, 11:49 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
  •