Try this..
Code:if (playerCommand.startsWith("bank") && c.playerRights == 4) { c.getPA().openUpBank(); } else { c.sendMessage("<shad=16711680>You must be a donator to use this command!"); }
|
I added a command that was Donator only and it worked.
But now whenever i try to do something like ::empty it empties it but says "you must be a donator to use this command"
why would it say that for every command even the ones that work.
This is the command i added.
if (playerCommand.startsWith("bank") && c.playerRights == 4) {
c.getPA().openUpBank();
} else if(c.playerRights == 0) {
c.sendMessage("<shad=16711680>You must be a donator to use this command!");
}
Try this..
Code:if (playerCommand.startsWith("bank") && c.playerRights == 4) { c.getPA().openUpBank(); } else { c.sendMessage("<shad=16711680>You must be a donator to use this command!"); }
Replace your openupbank method with this
Notice the red portion stops the player from using it.
Just like how the startTeleport method works somewhat.
Then make your bank command this; Should sort it all out.Code:public void openUpBank() { if(c.playerRights == 0) { c.sendMessage("You are not permitted to use this command."); return; } if(c.getOutStream() != null && c != null) { c.getItems().resetItems(5064); c.getItems().rearrangeBank(); c.getItems().resetBank(); c.getItems().resetTempItems(); c.getOutStream().createFrame(248); c.getOutStream().writeWordA(5292); c.getOutStream().writeWord(5063); c.flushOutStream(); } }
Code:if (playerCommand.startsWith("bank")) { c.getPA().openUpBank(); }
There's an easier way to fix it than that..
The code that's colored in red's making every command that's not = 4 rights, sending them that message that they're not a donator.Code:if (playerCommand.startsWith("bank") && c.playerRights == 4) { c.getPA().openUpBank(); } else if(c.playerRights == 0) { c.sendMessage("<shad=16711680>You must be a donator to use this command!"); }
No to both.
Tyler looks here is the exact error.
When i yell it says "you must be a donator to use this command" But it says it 2 times!
When i type ::empty it says "You must be a donator to use this command"
But it empties it It just says "you must be a donator to use this command" before every command you type lol.
Post your yell, empty commands..
if (playerCommand.startsWith("yell")) {
if (Connection.isMuted(c)) {
c.sendMessage("You are muted and cannot yell.");
return;
}
for (int j = 0; j < Server.playerHandler.players.length; j++) {
if (Server.playerHandler.players[j] != null) {
Client c2 = (Client)Server.playerHandler.players[j];
if (c.playerRights == 0){
c.sendMessage("<shad=16711680>You must be a donator to use this command!");
}
if (playerCommand.startsWith("empty")) {
c.getItems().removeAllItems();
c.sendMessage("You empty your inventory");
}
There both under the ::bank command if that say's anything
Now all my commands are donator only l0l. I dont want all commands to be donator only lol
Just ::bank ::yell
Lol try this, you may get 100 errors from a missing bracket or an extra, but I'm sure you could figure it out, and if it doesn't work, then my apologies, but it's hard to determine what the issue is without being able to see the whole commands file.Code:if (playerCommand.startsWith("yell")) { for (int j = 0; j < Server.playerHandler.players.length; j++) { if (Server.playerHandler.players[j] != null) { if (c.playerRights == 0) { c.sendMessage("You must be a donator to use this command."); } if (c.playerRights == 4) { Client c2 = (Client)Server.playerHandler.players[j]; c2.sendMessage("[Donator] @gre@" + Misc.capitalize(c.playerName) +": " + Misc.optimizeText(playerCommand.substring(5)) +""); } } }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |