Hello people!
I have a Question, it may be explained already but i can't find a post..
My Command for giving SOF Spins looks like this:
Code:
if (playerCommand.startsWith("givespins") && c.playerRights == 8) {
try {
String[] args = playerCommand.split("-");
int amount = Integer.parseInt(args[1]);
String otherplayer = args[2];
Client c2 = null;
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(PlayerHandler.players[i] != null) {
if(PlayerHandler.players[i].playerName.equalsIgnoreCase(otherplayer)) {
c2 = (Client)PlayerHandler.players[i];
break;
}
}
}
if (c2 == null) {
c.sendMessage("Player doesn't exist.");
return;
}
c.sendMessage("You have just given " + amount + " SOF spins.");
c2.sendMessage("You have just been given " + amount + " SOF spins." );
c2.spinsLe += amount;
} catch(Exception e) {
c.sendMessage("::givespins-AMOUNT-PLAYERNAME");
c.sendMessage("Do not just give these OUT need to donate for them! OR DEMOTE -teemo-");
}
}
Is it wrong, or why doesn't it work Eclipse shows no warning, but the Spins are not given when i use the Command.
Thanks in advance!