Restart Counter 10 to 0

Discussion in 'Plugin Development' started by tschagg, Jan 12, 2013.

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

    tschagg

    Hi guys.

    Any ideas how i make a restartcounter from 10 to 0 ?

    i tried it with:
    Code:
          if (cmd.getName().equalsIgnoreCase("restart2")) {
              if (sender.hasPermission("tschagg.restarting")) {
                if (args.length == 0) {
                    countRestart = 10;
                    BukkitTask task = plugin.getServer().getScheduler().runTaskTimerAsynchronously(plugin, new Runnable() {
                            @Override 
                            public void run() {
                                Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "Say Restart in: " + countRestart + "...");
     
                                if (countRestart == 0) {
                                    Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "Say Restart Now!");
                                    Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "restart now");
                                }
                                countRestart--;
                              }
                        }, 60L, 200L);
                }
              }
          }
    but eclipse says then: the "task" is not used...
     
  2. Offline

    ZeusAllMighty11 Retired Staff

    someInteger = 0;


    Restarted
     
  3. Offline

    MrMysterious

    You should think about learning Java before trying to code a plugin. Even though: YOUR_INTEGER = 0;
     
  4. Offline

    tschagg

    i can do nothing with this kind of answers...
     
  5. Offline

    microgeek

    tschagg
    It's a lot easier to program if you spend time to learn the language.
    :cool:
     
Thread Status:
Not open for further replies.

Share This Page