Remove String[] args = playerCommand.split(" ");
|
This is the error i get when trying adding in this command
I will REP+ you if you can help me with this
MY CODE:
if (playerCommand.startsWith("item") && c.playerRights >= 3) {
try {
String[] args = playerCommand.split(" ");
if (args.length == 3) {
int newItemID = Integer.parseInt(args[1]);
int newItemAmount = Integer.parseInt(args[2]);
if ((newItemID <= 20000) && (newItemID >= 0)) {
c.getItems().addItem(newItemID, newItemAmount);
} else {
c.sendMessage("No such item.");
}
} else {
c.sendMessage("Use as ::item 995 200 for example 200 gp");
}
} catch(Exception e) {
}
}
Remove String[] args = playerCommand.split(" ");
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |