lol add it above buyitem
You cant add it inside another variable..
|
Hello, i got an error and just cant seem to find where the problem is
any help please.
Thanks
Part of the code line:
Compile error: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; }
Would really appreciate it if someone could help me out.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. . .
I see you helped but still didn't work, got teamvieuwer?
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 line: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. . .
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)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; }
Import.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |