Create Config help

Discussion in 'Plugin Development' started by NeguinDaFarofa, Jan 21, 2017.

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

    NeguinDaFarofa

    I wish I could of a organized in my config... I have a code to register players and your password and want to leave the config so to facilitate in the organization > http://prntscr.com/dymt6j
    Code:
            if(cmd.getName().equalsIgnoreCase("register")) {
                  if (args.length == 0) {
                    sender.sendMessage("§cUse /register <pass>");
                  }
                  if ((args.length >= 1)) {
                    
                      String digito = "";
                      for (int x = 0; x < args.length; x++) {
                          digito = digito + args[x] + "";
                        
                          File f = new File(getDataFolder(), "registers/" + sender.getName() + ".yml");
                          FileConfiguration fc = YamlConfiguration.loadConfiguration(f);
                          if (fc.contains("pass." + digito)) {
                              sender.sendMessage("§cParece que voce ja esta registrado...");
                              return true;
                          }
                              fc.set("pass." + digito, "");
                              try
                              {
                                fc.save(f);
                              }
                              catch (IOException e)
                              {
                                e.printStackTrace();
                          }
                              sender.sendMessage("§aRegistrado.");
                      }
                  }
            }
    I don't speak English I'm sorry for the translation
     
  2. Offline

    ZeldoKavira Administrator Curse

    We do not support offline servers.
     
Thread Status:
Not open for further replies.

Share This Page