Jump to content
  • 0
Sign in to follow this  
finalfight

Compiling error - cannot find symbol

Question

Hi guys,
I am receiving the following error:
[CODE]compiling...
src\com\rs\game\player\content\Commands.java:4785: error: cannot find symbol
VoteReward reward = Launcher.vote.hasVoted(player.getUserna
me().toLowerCase().replaceAll(" ", "_"));
^
symbol: variable vote
location: class Launcher
Note: src\com\rs\game\player\Inventory.java uses unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.
1 error
Press any key to continue . . .[/CODE]


This is the commands.java vote command
[CODE] if (cmd[0].equalsIgnoreCase("claim") || cmd[0].equalsIgnoreCase("voted")) {
try {
VoteReward reward = Launcher.vote.hasVoted(player.getUsername().toLowerCase().replaceAll(" ", "_"));
if(reward != null){
switch(reward.getReward()){
case 0:
if(player.getInventory().getFreeSlots() > 1) {
player.getInventory().addItem(8851, 10000000);
player.getPackets().sendGameMessage("Your reward has been added to your inventory.");
} else {
player.getBank().addItem(8851, 10000000, true);
player.getPackets().sendGameMessage("Your reward has been added to your bank.");
}//u dont have method .sendworldmessage?its something else i think like sendsomehting idkgsihmome wt hwaiet 2 secs
player.getPackets().sendGameMessage("<shad=66FF33><img=6>[News] "+player.getDisplayName()+" Has just voted for 10 Million upgrade tokens!", false);
break;
case 1:
if(player.getInventory().getFreeSlots() > 1) {
player.getInventory().addItem(995, 25000000);
player.getPackets().sendGameMessage("Your reward has been added to your inventory.");
} else {
player.getBank().addItem(995, 25000000, true);
player.getPackets().sendGameMessage("Your reward has been added to your bank.");
}
player.getPackets().sendGameMessage("<shad=66FF33><img=6>[News] "+player.getDisplayName()+" Has just voted for 25 Million coins!", false);
break;
case 2:
if(player.getInventory().getFreeSlots() > 1) {
player.getInventory().addItem(12852, 6000000);
player.getPackets().sendGameMessage("Your reward has been added to your inventory.");
} else {
player.getBank().addItem(12852, 6000000, true);
player.getPackets().sendGameMessage("Your reward has been added to your bank.");
}
player.getPackets().sendGameMessage("<shad=66FF33><img=6>[News] "+player.getDisplayName()+" Has just voted for 6 Million pvp tokens!", false);
break;
case 3: //ty :P
if(player.getInventory().getFreeSlots() > 1) {
player.getInventory().addItem(1464, 1);
player.getPackets().sendGameMessage("Your reward has been added to your inventory.");
} else {
player.getBank().addItem(1464, 1, true);
player.getPackets().sendGameMessage("Your reward has been added to your bank.");
}
player.getPackets().sendGameMessage("<shad=66FF33><img=6>[News] "+player.getDisplayName()+" Has just voted for 1 vote ticket!", false);
break;
//add more hereOPEN FUCKING ECLIPSE il eat mm e madlet me do it ?
default:
player.getPackets().sendGameMessage("Reward not found.");
break;
}
player.getPackets().sendGameMessage("Thank you for voting.");
} else {
player.getPackets().sendGameMessage("You have no items waiting for you.");
}
} catch (Exception e){
player.getPackets().sendMessage(99, "[GTL Vote] An SQL error has occured.", player);
}
return true;

}[/CODE]

Could anyone help me? (It's probably easy to solve, but thank you.)

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0
If you added the auto vote you need to import launcher.java

Share this post


Link to post
Share on other sites
  • 0
[quote name='falconpunch']If you added the auto vote you need to import launcher.java[/QUOTE]

Hi Falcon.
I did.
I have: import com.rs.Launcher; at the commands.java

Share this post


Link to post
Share on other sites
  • 0
[quote name='finalfight']Hi Falcon.
I did.
I have: import com.rs.Launcher; at the commands.java[/QUOTE]

I'm on my phone right now, so my help is limited. Try and use eclipse, it may point it out to you.

Share this post


Link to post
Share on other sites
  • 0
In Launcher.java, either there is no variable by the name of 'vote', or the access modifier is improperly set.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×