Solved Help with Temban plugin

Discussion in 'Plugin Development' started by allestbs, Mar 24, 2014.

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

    allestbs

    Hello people,

    I'm making my own custom ban plugin, but i can't figure out how to maken a temp ban system, any help?
     
  2. Offline

    BeMacized

    Upon ban, kick the player, and save the return value of System.currentTimeMillis() to a file about the player, including the time period he'll be banned for, in milliseconds. Then once the player tries to join (PlayerJoinEvent probably), check if System.currentTimeMillis() is lower than (System.currentTimeMillis() + ban-period-in-milliseconds). If it is, the user is still banned, and should be kicked.

    That's how i'd try doing it
     
  3. Offline

    allestbs

    yes, i get the point, but i will do it with a command, like this: /server temban <player> 1h or something, how can i do that?
     
  4. Offline

    MisterPhiloe

    onCommand + args
     
  5. Offline

    allestbs

    yes, i'm not a noob in java x) but how did i do the 1h and translate it to a normal date?

    bump...

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  6. Offline

    allestbs

    Nobody knows?
     
  7. Offline

    Azubuso

    allestbs
    One millisecond is 0.001 seconds, do the math my friend :)
     
  8. Offline

    allestbs

    @Azuboso
    can you give me some code?
     
  9. Offline

    Venexor

    allestbs I suggest looking at the TimeParser class by Chinwe. His class allows you to convert 5m4d to whatever the correct time should be.
     
  10. Offline

    allestbs

    can you give me an example?
     
  11. Offline

    CrazyGuy3000

    Can you stop asking for code and atleast try this for yourself?

    Were not here to give you code, were here to help you with your problem.
     
  12. Offline

    allestbs

    iknow, but i'm now at school, i will try it at home :S
     
  13. Offline

    SpiritGamerr

    Only thing you want is code, so you dont have to do it yourself.
    We are helping you, only giving you the code for it isn't really helping you.
     
Thread Status:
Not open for further replies.

Share This Page