Deathban Timer

Discussion in 'Plugin Development' started by MagicPlus, Mar 1, 2012.

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

    MagicPlus

    I just finished developing my deathban plugin. The problem is, it permanently bans players instead of only banning them for like 10 days which I want it to ban for. Or even better, a configurable file for the ban time. Thanks! Also, this is my first ever plugin, so should I release it?

    I'm still in need of some help. Any suggestions or anything?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 24, 2016
  2. Offline

    acuddlyheadcrab

    Umm... There's a java.util method for getting the system time i think. Oh, duh -
    Code:java
    1. Long time = System.currentTimeMillis(); //returns a long format number


    Use that to get the time of when they were banned, save to a file, then in a scheduler compare the new current time to the banned time. If it's greater then or equal to the config's ban time, then un-ban the player.

    Now, it might get a bit more complicated when doing that for specific players, but it's possible.
     
Thread Status:
Not open for further replies.

Share This Page