Thread: [PI] error

Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1 [PI] error 
    Registered Member Delx's Avatar
    Join Date
    Jul 2011
    Age
    28
    Posts
    321
    Thanks given
    100
    Thanks received
    21
    Rep Power
    11
    Hello, i got an error and just cant seem to find where the problem is
    any help please.
    Thanks

    Part of the code line:
    Code:
    public boolean buyItem(int itemID, int fromSlot, int amount) {
    	
    public int gvp(int i)
    		{
    			switch(i)
    			{
    				case 962: return 250;
    							}
    							return 0;
    						}
    		if (c.myShopId == 14) {
    			skillBuy(itemID);
    			return false;
    		} else if (c.myShopId == 15) {
    			buyVoid(itemID);
    			return false;		
    		}
    Compile error:
    Code:
    src\server\model\shops\ShopAssistant.java:325: error: illegal start of expressio
    n
    public int gvp(int i)
    ^
    src\server\model\shops\ShopAssistant.java:325: error: ';' expected
    public int gvp(int i)
                  ^
    src\server\model\shops\ShopAssistant.java:325: error: ';' expected
    public int gvp(int i)
                        ^
    3 errors
    Druk op een toets om door te gaan. . .
    Would really appreciate it if someone could help me out.

    There's no sense getting Pissed off,
    every time a bunch of idiots give you a hard time.
    In the end, "The universe tends to unfold as it should".

    Reply With Quote  
     

  2. #2  
    Dark-Perfection Owner

    Join Date
    Jun 2012
    Posts
    485
    Thanks given
    51
    Thanks received
    45
    Rep Power
    22
    lol add it above buyitem
    You cant add it inside another variable..


    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member

    Join Date
    Mar 2011
    Posts
    1,226
    Thanks given
    245
    Thanks received
    475
    Rep Power
    294
    Code:
    public boolean buyItem(int itemID, int fromSlot, int amount) {
    			if (c.myShopId == 14) {
    			skillBuy(itemID);
    			return false;
    		} else if (c.myShopId == 15) {
    			buyVoid(itemID);
    			return false;		
    		}
    }
    public int gvp(int i)
    		{
    			switch(i)
    			{
    		case 962: 
    			return 250;
    		}
    		return 0;
    	}
    Reply With Quote  
     

  5. Thankful user:


  6. #4  
    Dark-Perfection Owner

    Join Date
    Jun 2012
    Posts
    485
    Thanks given
    51
    Thanks received
    45
    Rep Power
    22
    truelife, thats what i said....


    Reply With Quote  
     

  7. Thankful user:


  8. #5  
    Registered Member Delx's Avatar
    Join Date
    Jul 2011
    Age
    28
    Posts
    321
    Thanks given
    100
    Thanks received
    21
    Rep Power
    11
    I see you helped but still didn't work, got teamvieuwer?

    There's no sense getting Pissed off,
    every time a bunch of idiots give you a hard time.
    In the end, "The universe tends to unfold as it should".

    Reply With Quote  
     

  9. #6  
    Dark-Perfection Owner

    Join Date
    Jun 2012
    Posts
    485
    Thanks given
    51
    Thanks received
    45
    Rep Power
    22
    Post errors.


    Reply With Quote  
     

  10. #7  
    Astrect Developer

    Join Date
    Oct 2008
    Age
    28
    Posts
    1,936
    Thanks given
    369
    Thanks received
    212
    Rep Power
    591
    Quote Originally Posted by n33b View Post
    I see you helped but still didn't work, got teamvieuwer?
    What didn;t work about it?
    Reply With Quote  
     

  11. #8  
    Registered Member Delx's Avatar
    Join Date
    Jul 2011
    Age
    28
    Posts
    321
    Thanks given
    100
    Thanks received
    21
    Rep Power
    11
    Fixed it, i followed a Vote4point tut and now when i fixed the error i talk'd about i get this one, The tutorial said replace the URL spot with your url and i'm not sure what "spot"

    Code:
    src\server\model\players\Client.java:257: error: cannot find symbol
                            URL url = new URL(urlString);
                            ^
      symbol:   class URL
      location: class Client
    src\server\model\players\Client.java:257: error: cannot find symbol
                            URL url = new URL(urlString);
                                          ^
      symbol:   class URL
      location: class Client
    src\server\model\players\Client.java:258: error: cannot find symbol
                            BufferedReader reader = new BufferedReader(new InputStre
    amReader(url.openStream()));
                            ^
      symbol:   class BufferedReader
      location: class Client
    src\server\model\players\Client.java:258: error: cannot find symbol
                            BufferedReader reader = new BufferedReader(new InputStre
    amReader(url.openStream()));
                                                        ^
      symbol:   class BufferedReader
      location: class Client
    src\server\model\players\Client.java:258: error: cannot find symbol
                            BufferedReader reader = new BufferedReader(new InputStre
    amReader(url.openStream()));
                                                                           ^
      symbol:   class InputStreamReader
      location: class Client
    src\server\model\players\Client.java:266: error: cannot find symbol
                    } catch (MalformedURLException e) {
                             ^
      symbol:   class MalformedURLException
      location: class Client
    src\server\model\players\Client.java:268: error: cannot find symbol
                    } catch (IOException e) {
                             ^
      symbol:   class IOException
      location: class Client
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    7 errors
    Druk op een toets om door te gaan. . .
    code line:
    Code:
    public boolean checkVotes(String playerName) {
                    try {
                            String urlString = ""+playerName;
                            urlString = urlString.replaceAll(" ", "%20");
                            URL url = new URL(urlString);
                            BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
                            String results = reader.readLine();
                            if(results.length() > 0) {
                                    if(results.equals("user needs reward..."))
                                            return true;
                                    else 
                                            return false;
                            }
                    } catch (MalformedURLException e) {
                            System.out.println("Malformed URL Exception in checkVotes(String playerName)");
                    } catch (IOException e) {
                            System.out.println("IO Exception in checkVotes(String playerName)");
                    }
                    return false;
            }
    edit: i think i need to put it where it says new URL (in green) but i'm not sure bout the first "URL" (in red)

    There's no sense getting Pissed off,
    every time a bunch of idiots give you a hard time.
    In the end, "The universe tends to unfold as it should".

    Reply With Quote  
     

  12. #9  
    Registered Member

    Join Date
    Sep 2011
    Posts
    1,140
    Thanks given
    385
    Thanks received
    398
    Rep Power
    474
    Import.
    Reply With Quote  
     

  13. #10  
    Registered Member Delx's Avatar
    Join Date
    Jul 2011
    Age
    28
    Posts
    321
    Thanks given
    100
    Thanks received
    21
    Rep Power
    11
    Quote Originally Posted by null View Post
    Import.
    What do you mean

    There's no sense getting Pissed off,
    every time a bunch of idiots give you a hard time.
    In the end, "The universe tends to unfold as it should".

    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. Replies: 4
    Last Post: 02-23-2012, 10:54 PM
  2. Replies: 2
    Last Post: 01-26-2012, 03:38 PM
  3. Replies: 9
    Last Post: 10-20-2011, 07:52 AM
  4. Replies: 6
    Last Post: 09-15-2010, 04:20 PM
  5. Replies: 6
    Last Post: 05-01-2010, 05:18 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
  •