there's a "return;" thing before that code, so the error is that the code isn't able to be reached, and is not usable.
|
I get the error
client.java:22546: error: unreachable statement
if(playerCommand.startsWith("claim")){
^
This is the command I'm trying to use
if(playerCommand.startsWith("claim")){
client.rspsdata(client, client.playerName);
}
please help. been trying to fix this for 5 hours.
there's a "return;" thing before that code, so the error is that the code isn't able to be reached, and is not usable.
post the code above the command you're trying to add
public void rspsdata(client c, String username){
try{
username = username.replaceAll(" ","_");
String secret = "05edf455cb266ccb3ea3ac2715f87326"; //YOUR SECRET KEY!
String email = "[email protected]"; //This is the one you use to login into RSPS-PAY
URL url = new URL("http://rsps-pay.com/includes/listener.php?username="+username+"&secret="+secret +"&email="+email);
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
String results = reader.readLine();
if(results.toLowerCase().contains("!error:")){
}else{
String[] ary = results.split(",");
for(int i = 0; i < ary.length; i++){
switch(ary[i]){
case "0":
//donation was not found tell the user that!
break;
case "FIRSPRODUCTID": //product ids can be found on the webstore page
//add items for the first product
break;
case "SECONDPRODUCTID": //product ids can be found on the webstore page
//add items for the second product here!
break;
}
}
}
}catch(IOException e){}
}
thats the code, heres the command
if(playerCommand.startsWith("claim")){
client.rspsdata(client, client.playerName);
}
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |