look at the stuff you added in commands.java you proabably forgot a ";" or it could be "+args[1])+" with the ")"
|
Code:src\server\model\players\packets\Commands.java:767: not a statement c.sendMessage("Y ou gave "+ Integer.parseInt(args[2])+" points to "+args[1])+", he has now "+c2.p cPoints+" points."); ^ src\server\model\players\packets\Commands.java:767: ';' expected c.sendMessage("Y ou gave "+ Integer.parseInt(args[2])+" points to "+args[1])+", he has now "+c2.p cPoints+" points."); ^ 2 errors
look at the stuff you added in commands.java you proabably forgot a ";" or it could be "+args[1])+" with the ")"
edit: nvm didn't read
heres mine commandCode:if (playerCommand.startsWith("giversz")) { try { String[] args = playerCommand.split(" "); for(int i = 0; i < Config.MAX_PLAYERS; i++) { if(Server.playerHandler.players[i] != null) { if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1])) { Client c2 = (Client)Server.playerHandler.players[i]; c2.pcPoints = Integer.parseInt(args[2]); c.sendMessage("You gave "+ Integer.parseInt(args[2])+" points to "+args[1])+", he has now "+c2.pcPoints+" points."); c2.sendMessage("You recieve "+Integer.parseInt(args[2])+", you now have "+c2.pcPoints+"."); } } } } catch(Exception e) { c.sendMessage("Player must be offline."); } }
use eclipse...ffs
it was the args use this
if (playerCommand.startsWith("giversz")) {
try {
String[] args = playerCommand.split(" ");
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(args[1])) {
Client c2 = (Client)Server.playerHandler.players[i];
c2.pcPoints = Integer.parseInt(args[2]);
c.sendMessage("You gave "+ Integer.parseInt(args[2])+" points to "+args[1]+", he has now "+c2.pcPoints+" points.");
c2.sendMessage("You recieve "+Integer.parseInt(args[2])+", you now have "+c2.pcPoints+".");
}
}
}
} catch(Exception e) {
c.sendMessage("Player must be offline.");
}
}
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |