Originally Posted by
Dri Comics
When you claim your reward do something alike this.
Code:
c2.sendMessage("[VOTE]: "+c.playerName+" has just voted Make sure you vote as well!");
Code:
src\server\model\players\packets\Commands.java:219: error: cannot find symbol
c2.sendMessage("[VOTE]: "+c.p
layerName+" has just voted Make sure you vote as well!");
^
symbol: variable c2
location: class Commands
The command itself
Code:
if (playerCommand.equalsIgnoreCase("claim") || playerCommand.equalsIgnoreCase("reward")) {
try {
VoteReward reward = Server.vote.hasVoted(c.playerName.replaceAll(" ", "_"));
if(reward != null){
switch(reward.getReward()){
case 0:
c.getItems().addItem(6199, 1);
c2.sendMessage("[VOTE]: "+c.playerName+" has just voted Make sure you vote as well!");
break;
case 1:
c.getItems().addItem(10934, 1);
c2.sendMessage("[VOTE]: "+c.playerName+" has just voted Make sure you vote as well!");
break;
default:
c.sendMessage("Reward not found.");
break;
}
c.sendMessage("Thank you for voting.");
} else {
c.sendMessage("You have no items waiting for you.");
}
} catch (Exception e){
c.sendMessage("[GTL Vote] A SQL error has occured.");
}
}