Thread: ::claim command problem

Results 1 to 7 of 7
  1. #1 ::claim command problem 
    Registered Member blastashes's Avatar
    Join Date
    Apr 2012
    Age
    29
    Posts
    175
    Thanks given
    3
    Thanks received
    4
    Rep Power
    17
    Hello, when i make the ::claim command or as i have it here in 3 different commands seperated.

    here is the problem i'm having.

    I think maybe like the command doesn't end before the next one or something? so any help to fix this would be appreciated.

    It sends the else's from the other commands.

    here is the code

    Code:
    if (playerCommand.equals("deliverbox") && (c.playerRights >= 0) && (c.getItems().playerHasItem(15674, 1))) {
    			c.getItems().addItem(6199, 5);
                    	c.getItems().deleteItem(15674, 1);
    			c.sendMessage("Enjoy your 5 mystery donator boxes, hope you get something good!");
    		} else {
    			c.sendMessage("You need a delivery box to exchange!");
    						}
    					
    if (playerCommand.equals("delivercrate1") && (c.playerRights >= 0) && (c.getItems().playerHasItem(7630, 1))) {
    			c.getItems().addItem(18782, 5);
    			c.getItems().deleteItem(7630, 1);
    			c.sendMessage("Enjoy your 5 slayer xp lamps!");
    		} else {
    			c.sendMessage("You need a delivery crate to exchange!");
    		}
    if (playerCommand.equals("delivercrate2") && (c.playerRights >= 0) && (c.getItems().playerHasItem(7630, 1))) {
    			c.getItems().addItem(18783, 5);
    			c.getItems().deleteItem(7630, 1);
    			c.sendMessage("Enjoy your 5 summoning xp lamps!");
    		} else {
    			c.sendMessage("You need a delivery crate to exchange!");
    		}
    and here is a picture of what happens when i use one of the commands.




    Any help is appreciated, please no flame/hate/lmgtfy, thankyou.
    Reply With Quote  
     

  2. #2  
    Extreme Donator


    Join Date
    Dec 2007
    Posts
    649
    Thanks given
    117
    Thanks received
    61
    Rep Power
    105
    start your commands with this
    Code:
    if (playerCommand.equalsIgnoreCase("Cmd")) {
    Reply With Quote  
     

  3. #3  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    31
    Posts
    4,721
    Thanks given
    199
    Thanks received
    1,256
    Rep Power
    1114
    use notepad++ and you can spot brackets easier.
    Reply With Quote  
     

  4. #4  
    Registered Member r0fl dr0pped's Avatar
    Join Date
    Feb 2012
    Posts
    394
    Thanks given
    20
    Thanks received
    5
    Rep Power
    23
    Is this for vote, or what? If it's for vote you might not of posted the correct webiste url?
    Reply With Quote  
     

  5. #5  
    Registered Member blastashes's Avatar
    Join Date
    Apr 2012
    Age
    29
    Posts
    175
    Thanks given
    3
    Thanks received
    4
    Rep Power
    17
    no this isn't for vote, it's an item they get in game, this is kind of like redeeming it.
    but it sends the other cmd's else's thats the problem i'm having
    Reply With Quote  
     

  6. #6  
    Howdy

    nMik's Avatar
    Join Date
    Nov 2010
    Posts
    1,060
    Thanks given
    144
    Thanks received
    147
    Rep Power
    107
    Code:
    if (playerCommand.equals("delivery") && c.playerRights >= 0))
    		{
    			if(c.getItems().playerHasItem(15674, 1)) 
    				{
    					c.getItems().addItem(6199, 5);
    					c.getItems().deleteItem(15674, 1);
    					c.sendMessage("Enjoy your 5 mystery donator boxes, hope you get something good!");
    				}
    			if(c.getItems().playerHasItem(7630, 1))
    				{
    					c.getItems().addItem(18782, 5);
    					c.getItems().deleteItem(7630, 1);
    					c.sendMessage("Enjoy your 5 slayer xp lamps!");
    				}
    			if(c.getItems().playerHasItem(7630, 1)) 
    				{
    					c.getItems().addItem(18783, 5);
    					c.getItems().deleteItem(7630, 1);
    					c.sendMessage("Enjoy your 5 summoning xp lamps!");
    				}
    				else
    				{
    					c.sendMessage("You need a delivery box or crate to do that.");
    				}
    			}

    Reply With Quote  
     

  7. #7  
    Registered Member blastashes's Avatar
    Join Date
    Apr 2012
    Age
    29
    Posts
    175
    Thanks given
    3
    Thanks received
    4
    Rep Power
    17
    =0 wow, thats nice, i like how you put it all in one and called different items. cool, thx m8, ++rep
    the only thing, is that you have it calling 7630 twice, so if i made the command like that, it would i guess either error
    or give both types of lamps.
    maybe you thought i wanted it to give both idk
    but yeah i want it seperated so i guess i'll just edit the clickitem and make a 3rd box to give the slayer lamps.
    thanks m8
    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. [PI] Vote4Cash ::Claim Command
    By owner will in forum Help
    Replies: 3
    Last Post: 07-18-2012, 05:43 PM
  2. Replies: 6
    Last Post: 03-24-2012, 03:27 PM
  3. Replies: 7
    Last Post: 02-18-2012, 10:32 PM
  4. AUTODONATION PROBLEM!Webpage command problem!
    By Jay Gatsby in forum Help
    Replies: 5
    Last Post: 10-24-2011, 07:06 PM
  5. vote4cash claim command [562]
    By iSacred in forum Help
    Replies: 37
    Last Post: 07-11-2011, 03:16 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
  •