Thread: Public void problem..

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 Public void problem.. 
    Software Developer

    Tyrant's Avatar
    Join Date
    Jul 2013
    Age
    24
    Posts
    1,562
    Thanks given
    678
    Thanks received
    423
    Rep Power
    1060
    Hey i've messed around with clickingbuttons and playerassistant and i made a public void here with (Client c, int amount)
    And now it has this error when im doing c.getPA().c2k(); on clickingbuttons.
    The public void is called like that on playerassistant:

    public void c2k(Client c, int amount) {
    //W.e it does, it has no errors nor etc.
    }


    Then when i compile i got this error:

    Code:
    source\server\model\players\packets\ClickingButtons.java:3587: error: method c2k
     in class PlayerAssistant cannot be applied to given types;
                                    c.getPA().c2k();
                                             ^
      required: Client,int
      found: no arguments
    Any idea?
    Please tell me the fix
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Dec 2011
    Posts
    95
    Thanks given
    4
    Thanks received
    6
    Rep Power
    14
    You are not sending the parameters in. Do: c.getPA().c2k(c, amount);
    Reply With Quote  
     

  3. #3  
    Software Developer

    Tyrant's Avatar
    Join Date
    Jul 2013
    Age
    24
    Posts
    1,562
    Thanks given
    678
    Thanks received
    423
    Rep Power
    1060
    Quote Originally Posted by iAwesome View Post
    You are not sending the parameters in. Do: c.getPA().c2k(c, amount);
    Code:
    source\server\model\players\packets\ClickingButtons.java:3587: error: cannot fin
    d symbol
                                    c.getPA().c2k(c, amount);
                                                     ^
      symbol:   variable amount
      location: class ClickingButtons
    Still seems to not working..

    Please help
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Dec 2011
    Posts
    95
    Thanks given
    4
    Thanks received
    6
    Rep Power
    14
    Quote Originally Posted by DharokZ View Post
    Code:
    source\server\model\players\packets\ClickingButtons.java:3587: error: cannot fin
    d symbol
                                    c.getPA().c2k(c, amount);
                                                     ^
      symbol:   variable amount
      location: class ClickingButtons
    Still seems to not working..

    Please help
    Replace amount with the variable for amount, whatever you want. Lol
    If not post the c2k() method
    Reply With Quote  
     

  5. #5  
    Software Developer

    Tyrant's Avatar
    Join Date
    Jul 2013
    Age
    24
    Posts
    1,562
    Thanks given
    678
    Thanks received
    423
    Rep Power
    1060
    C2k method @ playerAssistant.java:

    Code:
    public void c2k(Client c, int amount) {
    String amt = Integer.toString(amount);
    		if(c.getItems().playerHasItem(989, amount)) {
    			c.getItems().deleteItem(989, amount);
    			c.getItems().addItem(5021, amount);
    			c.sendMessage("You've exchanged your "+amt+" crystal keys into "+amt+" 1b tickets.");
    		} else {
    		c.sendMessage("You don't have any ckeys to exchange");
    	}
    		if(c.getItems().freeSlots() == 0) {
    		c.sendMessage("Not enough space on your inventory");
    		}
    	}
    ClickingButtons.java part:
    Code:
    			if (c.dialogueAction == 600) {
    				c.getPA().c2k(c, amount);
    }
    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    Dec 2011
    Posts
    967
    Thanks given
    234
    Thanks received
    208
    Rep Power
    0
    Quote Originally Posted by DharokZ View Post
    C2k method @ playerAssistant.java:

    Code:
    public void c2k(Client c, int amount) {
    String amt = Integer.toString(amount);
    		if(c.getItems().playerHasItem(989, amount)) {
    			c.getItems().deleteItem(989, amount);
    			c.getItems().addItem(5021, amount);
    			c.sendMessage("You've exchanged your "+amt+" crystal keys into "+amt+" 1b tickets.");
    		} else {
    		c.sendMessage("You don't have any ckeys to exchange");
    	}
    		if(c.getItems().freeSlots() == 0) {
    		c.sendMessage("Not enough space on your inventory");
    		}
    	}
    ClickingButtons.java part:
    Code:
    			if (c.dialogueAction == 600) {
    				c.getPA().c2k(c, amount);
    }
    You need to pass an integer

    e.g. c.getPA().c2k(c, 50);
    Reply With Quote  
     

  7. #7  
    Software Developer

    Tyrant's Avatar
    Join Date
    Jul 2013
    Age
    24
    Posts
    1,562
    Thanks given
    678
    Thanks received
    423
    Rep Power
    1060
    Quote Originally Posted by Jet- View Post
    You need to pass an integer

    e.g. c.getPA().c2k(c, 50);
    But read the code its supposed to be they own int,
    Like if they want to exchange 500 ckeys they can type 500 or any number they want.
    How would i do that?
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Dec 2011
    Posts
    95
    Thanks given
    4
    Thanks received
    6
    Rep Power
    14
    Quote Originally Posted by DharokZ View Post
    But read the code its supposed to be they own int,
    Like if they want to exchange 500 ckeys they can type 500 or any number they want.
    How would i do that?
    Client sided.....
    Reply With Quote  
     

  9. #9  
    Owner of Dawntained

    Mgt Madness's Avatar
    Join Date
    Oct 2011
    Age
    28
    Posts
    3,380
    Thanks given
    1,429
    Thanks received
    958
    Rep Power
    2168
    Attached image
    Reply With Quote  
     

  10. #10  
    Software Developer

    Tyrant's Avatar
    Join Date
    Jul 2013
    Age
    24
    Posts
    1,562
    Thanks given
    678
    Thanks received
    423
    Rep Power
    1060
    Thats not something you can learn in a minute.
    Im using many guides and im still learning, i have to know it right know can you just give me the working method?
    Please?
    Reply With Quote  
     

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

Similar Threads

  1. [NEED]Public Void bankItem
    By Adam™ in forum Requests
    Replies: 0
    Last Post: 04-26-2010, 02:03 AM
  2. Public Voids
    By tucybro in forum Configuration
    Replies: 14
    Last Post: 06-18-2009, 10:25 PM
  3. Public Voids
    By tucybro in forum Tutorials
    Replies: 0
    Last Post: 06-17-2009, 11:30 AM
  4. [Delta] pnpc and public void npc glitch.
    By Slay No More in forum Help
    Replies: 0
    Last Post: 06-15-2009, 09:53 PM
  5. Replies: 0
    Last Post: 11-01-2008, 04:05 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
  •