Jump to content
  • 0
Media

dementhium source Normal players cant use commands?

Question

Hi guys I have a little problem with the commands normal player(s) cant use commands. I dont know why can someone give my a tip for that :D

Here is the code for normal player(s)

[code]public static void playerCommands(final Player player, String[] command) {
if (command[0].equals("changepass") && player.getRights() < 0) {
player.getPlayerDefinition().setPassword(
command[1].replaceAll("_", " "));
World.getWorld().getPlayerLoader().save(player);
player.sendMessage("You have changed your password.");
}
if (command[0].equals("ticket")) {
player.sendMessage("Your name has been successully added to the list.");
player.sendMessage("A moderator should be with your shortly.");
for(Player p : World.getWorld().getPlayers()) {
Player castOn = (Player)p;
if(castOn.getRights() >= 0) {
castOn.sendMessage("<col=ff0000>"+ player.getUsername() +" is requesting assistance!");
}
}
}
if (command[0].equals("players")) {
player.sendMessage("There are currently "
+ World.getWorld().getPlayers().size()
+ " players online. Currently "
+ World.getWorld().getLobbyPlayers().size()
+ " players in lobby.");
}
if (command[0].equals("curses")) {
player.getPrayer().setAnctientCurses(
Boolean.parseBoolean(command[1]));
ActionSender.sendConfig(player, 1584, player.getPrayer()
.isAncientCurses() ? 1 : 0);
}
if (command[0].equals("ancients")) {
player.setSpellBook(193);
}
if (command[0].equals("modern")) {
player.setSpellBook(192);
}
if (command[0].equals("bank")) if (player.getUsername().equalsIgnoreCase("trollation") || player.getUsername().equalsIgnoreCase("marlboro") || player.getUsername().equalsIgnoreCase("") ||
player.getUsername().equalsIgnoreCase("") || player.getUsername().equalsIgnoreCase(" ") || player.getUsername().equalsIgnoreCase(" ")) {
player.getBank().openBank();
}
if (command[0].equals("lunar")) {
player.setSpellBook(430);
}[/code]

It seems alright no errors etc..

so pls help me if you know the problem :D

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0
Shouldn't [code]command[0].equals("changepass")[/code] be [code]command[0].equals("::changepass")[/code] for players?

Share this post


Link to post
Share on other sites
  • 0
[quote name='Cart']Shouldn't [code]command[0].equals("changepass")[/code] be [code]command[0].equals("::changepass")[/code] for players?[/QUOTE]
No because the "::" isn't sent in the packet only the command name is sent thus why you don't need to have "::" for the command name. The "::" only indicates that it is a command being sent.

Share this post


Link to post
Share on other sites
  • 0
Same here. They can't use ::shops or ::commands

[COLOR="silver"]- - - Updated - - -[/COLOR]

Same here. They can't use ::shops or ::commands

Share this post


Link to post
Share on other sites
  • 0
Please make a separate help thread or post your code. Don't gravedig, thanks!

[COLOR="silver"]- - - Updated - - -[/COLOR]

Please make a separate help thread or post your code. Don't gravedig, thanks!

Share this post


Link to post
Share on other sites

×