Just remove the player rights, this bit >>Code:&& playerRights > 0) {
|
I want the command to be for normal players as well, Because i am making it a pickup server.Code:if (command.startsWith("pickup") && playerRights > 0) { String[] args = command.split(" "); if(args.length == 3) { int newItemID = Integer.parseInt(args[1]); int newItemAmount = Integer.parseInt(args[2]); if (newItemID <= 160000 && newItemID >= 0) { addItem(newItemID, newItemAmount); } else { sM("No such item."); } } else { sM("Oops! Use as ::pickup 4151 1"); } } }
I need the PlayerRights. I have tried 0 and it doesn't work.
Just remove the player rights, this bit >>Code:&& playerRights > 0) {
if (command.startsWith("pickup") {
String[] args = command.split(" ");
if(args.length == 3) {
int newItemID = Integer.parseInt(args[1]);
int newItemAmount = Integer.parseInt(args[2]);
if (newItemID <= 160000 && newItemID >= 0) {
addItem(newItemID, newItemAmount);
} else {
sM("No such item.");
}
} else {
sM("Oops! Use as :ickup 4151 1");
}
}
}
Thats the right one all the others are bullshit, the '<= 3' means that Owners and Under can use it... Eg Owner, admin, mod, player etc/Code:if (command.startsWith("pickup") && playerRights <= 3) { String[] args = command.split(" "); if(args.length == 3) { int newItemID = Integer.parseInt(args[1]); int newItemAmount = Integer.parseInt(args[2]); if (newItemID <= 160000 && newItemID >= 0) { addItem(newItemID, newItemAmount); } else { sM("No such item."); } } else { sM("Oops! Use as ::pickup 4151 1"); } } }
Thanks
Mr Silent
Ive done it.if (command.startsWith("pickup")) {
String[] args = command.split(" ");
if(args.length == 3) {
int newItemID = Integer.parseInt(args[1]);
int newItemAmount = Integer.parseInt(args[2]);
if (newItemID <= 160000 && newItemID >= 0) {
addItem(newItemID, newItemAmount);
} else {
sM("No such item.");
}
} else {
sM("Oops! Use as :ickup 4151 1");
}
}
}
Ohh yh i missed a bracket Oh well.
Anyway, Are you sure your ready for a RSPS if you cant even do that? Or are you a leecher?
Change sM to sendMessage.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |