Help Cooldown for 2 weeks

Discussion in 'Plugin Development' started by BananaBitchs, Dec 20, 2014.

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

    BananaBitchs

    Hey My name is Banana an i want to know how to do cool down for 2 weeks!!
    like tempban!!
    and if i stop the server its not reset ?
    plizz help!!!
     
    Last edited: Dec 20, 2014
  2. Offline

    ProStriker123

    Can you show me what you have done for now?

    You have set the value on the Config also?

    EDIT by Timtower: merged posts
     
    Last edited by a moderator: Dec 20, 2014
  3. Offline

    teej107

  4. Offline

    BananaBitchs

  5. Offline

    tcvs

    @BananaBitchs Well make time... People are not just going to hand you code... You need to learn to do it your self or you will not understand what your own plugin is doing...
     
    ChipDev likes this.
  6. Offline

    teej107

    CraftCreeper6 likes this.
  7. Offline

    BananaBitchs

    @teej107

    yes i did yhis now i have bag with the time!
    Code:
                        if (getKeys().containsKey(p.getName())){
                            long currentTime = System.currentTimeMillis();
                            long endTime = getKeys().get(p.getName()).longValue();
                            if(!(currentTime >= endTime)) {
                                getKeys().remove(p.getName());
                          }else{
                              long timeLeftTicks = (2 - endTime + currentTime);
                           p.sendMessage("You have: "+ Timeformat(timeLeftTicks / (20*60)));
                          }
                          }else{
                                     setKey(p.getName(), System.currentTimeMillis() / 500);
    [​IMG]

    Code:
    public static String Timeformat(long end)
          {
            String message = "";
           
            long now = System.currentTimeMillis();
            long diff = end - now;
            int seconds = (int)(diff / 1000L);
            if (seconds >= 86400)
            {
              int days = seconds / 86400;
              seconds %= 86400;
             
              message = message + days + " Day(s) ";
            }
            if (seconds >= 3600)
            {
              int hours = seconds / 3600;
              seconds %= 3600;
             
              message = message + hours + " Hour(s) ";
            }
            if (seconds >= 60)
            {
              int min = seconds / 60;
              seconds %= 60;
             
              message = message + min + " Minute(s) ";
            }
            if (seconds >= 0) {
              message = message + seconds + " Second(s) ";
            }
            return message;
          }
     
Thread Status:
Not open for further replies.

Share This Page