Help! Arguments of a command!

Discussion in 'Plugin Development' started by iLalox, Apr 14, 2015.

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

    iLalox

    Hi! First, if you misunderstand me, it is because I speak Spanish

    So I have a problem, I need to do a command, this: /ocupado eliminar NICK

    And I always failed to make the argument work, and to send you messages like: More arguments are needed! or: Specifies a valid user!

    Please help :c
     
  2. Offline

    Rocoty

    Hey. What have you tried so far?
     
  3. Hey si necesitas ayuda te puedo ayudar en español / Hey if you need some help i can help you on spanish .
     
    iLalox likes this.
  4. Offline

    nverdier

    @iLalox Wait so you're making a plugin? Please post code.
     
    iLalox likes this.
  5. Offline

    JoelyBob

    Hey Man!

    No estoy cien por ciento seguro, pero creo que con los argumentos y la parte apodo, este es el camino a seguir :
    //
    I am not 100% sure, but I believe with the arguments and the nickname part, this is the way to go:

    (Please tell me if there is something wrong/can be improved!)

    Code:
         if (cmd.getName().equalsIgnoreCase("ocupado")) {
            if (!p.hasPermission("ocupado.nick")) {
                 p.sendMessage(ChatColor.RED + "Usted no tiene permiso para utilizar este comando. (You do not have permission to use this command)"); }
            if(args.length == 2)
            if(args[1].equalsIgnoreCase("eliminar")) {
            if (args.length == 2) {
                 p.sendMessage(ChatColor.RED + "No ha especificado un apodo! (You did not specify a player!)");
                 if (args.length == 3) {
            }
          
            String nick = "";
            for (String arg : args) {
                    nick += arg + " ";
            }
          
            nick = nick.substring(0, nick.length() - 1);
          
            nick = nick.replaceAll("&", "§");
          
            p.sendMessage(ChatColor.GREEN + "Ha cambiado su apodo " + nick);
            this.getConfig().set(p.getName(), nick);
            this.saveConfig();
    }
     
    iLalox likes this.
  6. Offline

    JoelyBob

    If this is solved, please mark it as 'Solved'. Thanks!
    ----
    Si esto se resuelve , por favor marcarlo "resuelto " . Gracias!
     
  7. Offline

    Evaluations

    Where did he say he fixed his problem?
     
  8. Offline

    JoelyBob

    Where did he say he didn't? Plus it hasn't been active for a while.
     
Thread Status:
Not open for further replies.

Share This Page