Thread: please!!!

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 please!!! 
    GANGNAM STYLE!

    Ohad's Avatar
    Join Date
    Aug 2011
    Posts
    3,179
    Thanks given
    152
    Thanks received
    352
    Rep Power
    1671
    please i really need this tried to do it but it failed
    i need a code that when i click on a interface it will take a item and give me a different item and if i don't got it it will say i cant do it without this item! thanks

    Don't laugh cause i am still really new to coding java and want to learn!
    i tried making it but it failed
    in clickingbuttons.java
    Code:
    	case 116137:	(
    	if(itemId == 18820) {
    		c.getitems().deleteitem(18820);
    		c.getitems().deleteitem(995,5000000);
    		c.getItems().addItem(18820);
    	} else {
    		c.sendmessage("you don't have enough cash!");
    	}
    		)
    please respect that i am trying to learn!
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    May 2011
    Posts
    206
    Thanks given
    25
    Thanks received
    30
    Rep Power
    78
    here you go
    case 116137:
    if(itemId == 18820) {
    c.getitems().deleteitem(18820);
    c.getitems().deleteitem(995,5000000);
    c.getItems().addItem(18820);
    } else {
    c.sendmessage("you don't have enough cash!");
    }
    Check out my Revision Service!




    If you are reading this, you are now manually breathing.
    Reply With Quote  
     

  3. #3  
    Member
    Join Date
    Sep 2010
    Posts
    128
    Thanks given
    8
    Thanks received
    5
    Rep Power
    0
    Why the hell have you put brackets around it?
    Code:
    	case 116137:
    		if(itemId == 18820) {
    			c.getitems().deleteitem(18820);
    			c.getitems().deleteitem(995,5000000);
    			c.getItems().addItem(18820);
    		} else { c.sendmessage("you don't have enough cash!"); }
    		break;
    There's a method in the madness();
    Reply With Quote  
     

  4. #4  
    GANGNAM STYLE!

    Ohad's Avatar
    Join Date
    Aug 2011
    Posts
    3,179
    Thanks given
    152
    Thanks received
    352
    Rep Power
    1671
    Quote Originally Posted by TheTits View Post
    here you go
    i did that in the start...
    but then i got this
    Code:
    src\server\model\players\packets\ClickingButtons.java:94: error: cannot find sym
    bol
            if(itemId == 18820) {
               ^
      symbol:   variable itemId
      location: class ClickingButtons
    src\server\model\players\packets\ClickingButtons.java:95: error: cannot find sym
    bol
                    c.getitems().deleteitem(18820);
                     ^
      symbol:   method getitems()
      location: variable c of type Client
    src\server\model\players\packets\ClickingButtons.java:96: error: cannot find sym
    bol
                    c.getitems().deleteitem(995,5000000);
                     ^
      symbol:   method getitems()
      location: variable c of type Client
    src\server\model\players\packets\ClickingButtons.java:97: error: method addItem
    in class ItemAssistant cannot be applied to given types;
                    c.getItems().addItem(18820);
                                ^
      required: int,int
      found: int
      reason: actual and formal argument lists differ in length
    src\server\model\players\packets\ClickingButtons.java:99: error: cannot find sym
    bol
                    c.sendmessage("you don't have enough cash!");
                     ^
      symbol:   method sendmessage(String)
      location: variable c of type Client
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    5 errors
    Press any key to continue . . .
    and i get it again now
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Jun 2011
    Posts
    476
    Thanks given
    57
    Thanks received
    43
    Rep Power
    17
    Why are you even deleting item 18820 first and after that you add it ?

    edit:

    I think you want it that it will cost 5mil gp if im right and then it will add the item id 18820 if im right?

    Code:
    			case 116137:
    				if(c.getItems().playerHasItem(995, 5000000)) {
    					c.getItems().deleteItem(995, 5000000);
    					c.getItems().addItem(18820, 1);
    				} else {
    					c.sendMessage("You don't have enough coins!");
    				}
    				break;
    Reply With Quote  
     

  6. #6  
    GANGNAM STYLE!

    Ohad's Avatar
    Join Date
    Aug 2011
    Posts
    3,179
    Thanks given
    152
    Thanks received
    352
    Rep Power
    1671
    ow lol didn't see that :O
    Reply With Quote  
     

  7. #7  
    GANGNAM STYLE!

    Ohad's Avatar
    Join Date
    Aug 2011
    Posts
    3,179
    Thanks given
    152
    Thanks received
    352
    Rep Power
    1671
    so it suppose to look like this:

    Code:
    	case 116137:	
    	if(itemId == 15707) {
    		c.getitems().deleteitem(15707);
    		c.getitems().deleteitem(995,5000000);
    		c.getItems().addItem(18820);
    	} else {
    		c.sendmessage("you don't have enough cash!");
    	}
    but still same error
    Code:
    src\server\model\players\packets\ClickingButtons.java:94: error: cannot find sym
    bol
            if(itemId == 15707) {
               ^
      symbol:   variable itemId
      location: class ClickingButtons
    src\server\model\players\packets\ClickingButtons.java:95: error: cannot find sym
    bol
                    c.getitems().deleteitem(15707);
                     ^
      symbol:   method getitems()
      location: variable c of type Client
    src\server\model\players\packets\ClickingButtons.java:96: error: cannot find sym
    bol
                    c.getitems().deleteitem(995,5000000);
                     ^
      symbol:   method getitems()
      location: variable c of type Client
    src\server\model\players\packets\ClickingButtons.java:97: error: method addItem
    in class ItemAssistant cannot be applied to given types;
                    c.getItems().addItem(18820);
                                ^
      required: int,int
      found: int
      reason: actual and formal argument lists differ in length
    src\server\model\players\packets\ClickingButtons.java:99: error: cannot find sym
    bol
                    c.sendmessage("you don't have enough cash!");
                     ^
      symbol:   method sendmessage(String)
      location: variable c of type Client
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    5 errors
    Press any key to continue . . .
    Reply With Quote  
     

  8. #8  
    Member
    Join Date
    Sep 2010
    Posts
    128
    Thanks given
    8
    Thanks received
    5
    Rep Power
    0
    >.> Learn to read compiler output and fix it yourself...
    There's a method in the madness();
    Reply With Quote  
     

  9. #9  
    GANGNAM STYLE!

    Ohad's Avatar
    Join Date
    Aug 2011
    Posts
    3,179
    Thanks given
    152
    Thanks received
    352
    Rep Power
    1671
    thanks but i don't want to tv
    ok i changed it and made this:
    Code:
    	case 116137:
    		if(c.getItems().playerHasItem(995, 5000000)) {
    			c.getItems().deleteItem(995, 5000000);
    			c.getitems().deleteitem(15707, 1);
    			c.getItems().addItem(18820, 1);
    		} else {
    			c.sendMessage("You don't have enough coins!");
    				}
    	break;
    but i still got one more problem please help
    Code:
    src\server\model\players\packets\ClickingButtons.java:94: error: cannot find sym
    bol
                            c.getitems().deleteitem(15707, 1);
                             ^
      symbol:   method getitems()
      location: variable c of type Client
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    1 error
    Press any key to continue . . .
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Jun 2011
    Posts
    476
    Thanks given
    57
    Thanks received
    43
    Rep Power
    17
    Quote Originally Posted by ohadtobi View Post
    thanks but i don't want to tv
    ok i changed it and made this:
    Code:
    	case 116137:
    		if(c.getItems().playerHasItem(995, 5000000)) {
    			c.getItems().deleteItem(995, 5000000);
    			c.getitems().deleteitem(15707, 1);
    			c.getItems().addItem(18820, 1);
    		} else {
    			c.sendMessage("You don't have enough coins!");
    				}
    	break;
    but i still got one more problem please help
    Code:
    src\server\model\players\packets\ClickingButtons.java:94: error: cannot find sym
    bol
                            c.getitems().deleteitem(15707, 1);
                             ^
      symbol:   method getitems()
      location: variable c of type Client
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    1 error
    Press any key to continue . . .
    it should be:

    c.getItems capatalized i
    Reply With Quote  
     

  11. Thankful user:


Page 1 of 2 12 LastLast

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
  •