Command not working :/

Discussion in 'Plugin Help/Development/Requests' started by samyounes03, Jun 1, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    samyounes03

    Code:
            public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
                if (sender instanceof Player) {
                    Player player = (Player) sender;
                    int amount = Integer.parseInt(args[1]);
                    if (cmd.getName().equalsIgnoreCase("paycredits")){
                        econ.depositPlayer(args[0], amount);
                        player.sendMessage(ChatColor.GREEN + "You payed " + args[0] + " "  + args[1] + " credits");
                    }
                    else if (cmd.getName().equalsIgnoreCase("credits")){
                        player.sendMessage("The player samyounes03 has 100 credits!");
                    }
    }
                return false;
            }
    }
    
    "An internal error occured while attempting to perform this command" happens when i type /credits. Help please :)
     
  2. Offline

    mine-care

    @samyounes03 Can we see your full stacktrace from the console?
     
  3. Offline

    samyounes03

  4. Offline

    Timbals

  5. Offline

    samyounes03


    Log after restarting server. Anyway i gtg eat now. If you find out the problem pls tell me.
     
  6. Locked, duplicate thread. Please continue to use the old thread rather than making a brand new one.
     
Thread Status:
Not open for further replies.

Share This Page