Thread: Need help with commands

Results 1 to 5 of 5
  1. #1 Need help with commands 
    Registered Member randqm's Avatar
    Join Date
    Sep 2011
    Age
    31
    Posts
    136
    Thanks given
    2
    Thanks received
    29
    Rep Power
    15
    I made this code:
    Code:
    if (command.equalsIgnoreCase("buy santahat") && playerHasItem(995, 10000000)) {
    			addItem(1050, 1);
    			deleteItem(995, 10000000);
    }else{
    sM("You don't have 10,000,000 coins.");
    }
    if (command.equalsIgnoreCase("sell santahat")) {
    			addItem(995, 10000000);
    			deleteItem(1050, 1);
    }
    the sM("You don't have 10,000,000 coins.");
    should only be sent when the player tries to buy but doesn't have the money.
    Buy when I do :ell santahat
    I also get the sendmessage

    How do I fix this?
    Reply With Quote  
     

  2. #2  
    Registered Member
    Edd -'s Avatar
    Join Date
    Jul 2011
    Posts
    664
    Thanks given
    62
    Thanks received
    43
    Rep Power
    84
    Code:
    if (command.equalsIgnoreCase("sell santahat")) {
    			addItem(995, 10000000);
    			deleteItem(1050, 1);
    }else{
    sM("u sell your santa hat");
    }
    try that see if it works
    Reply With Quote  
     

  3. #3  
    My TFLOP is better than yours
    Sonic chao's Avatar
    Join Date
    Aug 2011
    Posts
    298
    Thanks given
    51
    Thanks received
    13
    Rep Power
    24
    Quote Originally Posted by bwuk _im_pb View Post
    Code:
    if (command.equalsIgnoreCase("sell santahat")) {
    			addItem(995, 10000000);
    			deleteItem(1050, 1);
    }else{
    sM("u sell your santa hat");
    }
    try that see if it works
    Code:
    if (command.equalsIgnoreCase("Sell santahat") && playerHasItem(1050, 1)) {
                              addItem(995, 10000000);
                              deleteItem(1050, 1);
    } else {
    sM("You don't have a Santa Hat to sell.");
    return;
    }
    Reply With Quote  
     

  4. #4  
    q.q


    Join Date
    Dec 2010
    Posts
    6,519
    Thanks given
    1,072
    Thanks received
    3,535
    Rep Power
    4752
    Code:
    if (command.equalsIgnoreCase("buy santahat") {
    		if (playerHasItem(995, 10000000)) {
    			addItem(1050, 1);
    			deleteItem(995, 10000000);
    		} else {
    			sM("You don't have 10,000,000 coins.");
    		}
    	}
    	if (command.equalsIgnoreCase("sell santahat")) {
    		if (playerHasItem(1050, 1)) {
    			addItem(995, 10000000);
    			deleteItem(1050, 1);
    		} else {
    			sM("You don't have santahat");
    		}
    	}
    Reply With Quote  
     

  5. #5  
    My TFLOP is better than yours
    Sonic chao's Avatar
    Join Date
    Aug 2011
    Posts
    298
    Thanks given
    51
    Thanks received
    13
    Rep Power
    24
    Wait, i think i fixed it:

    Code:
    if (command.equalsIgnoreCase("buy santahat") && playerHasItem(995, 10000000)) {
    			addItem(1050, 1);
    			deleteItem(995, 10000000);
    }else{
    sM("You don't have 10,000,000 coins.");
    return;
    }
    if (command.equalsIgnoreCase("sell santahat") && playerHasItem (1050, 1)) {
    			addItem(995, 10000000);
    			deleteItem(1050, 1);
    } else {
    sM("You don't have a Santa hat to sell");
    return;
    }
    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. Replies: 2
    Last Post: 06-07-2011, 08:29 PM
  2. Replies: 9
    Last Post: 11-28-2009, 05:39 AM
  3. Sell Commands / Buy Commands
    By 5simple5 in forum Help
    Replies: 5
    Last Post: 01-17-2009, 06:03 PM
  4. Replies: 19
    Last Post: 11-23-2008, 05:30 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •