Help please :)

Discussion in 'Plugin Development' started by MrPotatoMuncher, Mar 14, 2014.

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


    Can someone please explain in the easiest way possible how to do this
    /ban <temp or perma>
    If args[0] is temp
    /ban temp 1D Hacking in games
    if it's perma
    /ban perma Hacking in games

    I just want to know how to do the time check
    1D = 1 day
    1S = 1 second
    M = minute
    Mo = month
    Y = year

    Can someone make the easiest way to do this so I can know
    Thank you
  2. Offline


    Maybe this can help you. So you don't need to code the parsing and conversions yourself.
    Chinwe likes this.
  3. Offline


    CubieX thanks, now how to add to banning plugin I made
  4. Offline


    What do you have right now in your CommandHandler?
  5. Offline


    CubieX nothing atm as I don't know how to use new ban way, I use setBanned(true); not BanList
  6. Offline


  7. Offline


  8. Offline


  9. Offline


    It might be best to move temp banning to its own command, as it could get confusing if the ban reason begins at different arguments for temp and banning (ie /ban <player> perm <reason from args[2]> and /tempban <player> temp <time> <reason from args[3]>).

    To convert a time input (such as 1d2h5m18s), use TimeParser.parseString(timeInput) (which returns the amount of milliseconds in 1 day, 2 hours, 5 minutes and 18 seconds for example), and then ban them until (System.currentTimeMillis() + timeParserResult)
  10. Offline


    : O thank you it worked
Thread Status:
Not open for further replies.

Share This Page