BanClear

Discussion in 'Plugin Requests' started by YoloSanta, May 7, 2017.

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

    YoloSanta

    Hey guys I was wondering if someone could make me a plugin where when I ban someone with MaxBans it clears their inventory, sets them at spawn(if they get unbanned), and to clear all of their violations from NCP so basically

    When I ban a player
    - Clears Inventory
    - Teleports to spawn right before ban
    - Clears NCP Violations
    - Sets essentials bal to default
     
    Last edited: May 12, 2017
  2. Offline

    YoloSanta

  3. Offline

    jakemaster2003

    Wel i can look in to it and that you can set a custom bal in the config so it matches your neads but i do need to look for the remove NCP violation. But the rest i can make that pretty fast if you want.


    * UPDATE *

    Nevermind the plugin you ask support for does not have a API so i cannot get a trigger when a player gets banned with that plugin
     
    Last edited by a moderator: May 10, 2017
  4. Offline

    EndureBlackout

    Just do a command preprocess event...


    Sent from my iPhone using Tapatalk
     
  5. Online

    timtower Administrator Administrator Moderator

    @EndureBlackout Not very reliable though as there are aliases etc, error handling, plugins that run commands instead of players.
    @YoloSanta Wanted to help @jakemaster2003 to see if I could find any kind of API but then I noticed that Litebans was a paid plugin. Not much that we can do with that without buying it.
     
  6. Offline

    jakemaster2003

    Exactly, thats why.
     
  7. Offline

    YoloSanta

    Would it be better if I switched to MaxBans (free bukkit plugin) to create the BanClear plugin
     
  8. Online

    timtower Administrator Administrator Moderator

    Then we can use it at least so probably.
     
  9. Offline

    C.L.

    @YoloSanta You got any ideas for commands? Example (use this): /clearban (Alias: /cban). And you can't have a plugin without permissions(unless on OP system, unpopular these days). I'll give you some permission ideas: clearban.ban, clearban.exempt, clearban.money.exempt, clearban.inventory.exempt, clearban.spawn.exempt, clearban.clear.exempt(this one is exempt to the inventory and money clears).
     
  10. Offline

    YoloSanta

    Those are good commands and permissions those would work for me!

    Great! Im guessing C.L. is gonna work on it? Not sure
     
  11. Online

    timtower Administrator Administrator Moderator

  12. Offline

    YoloSanta

    Bump; still need a dev for this
     
  13. Offline

    jakemaster2003

  14. Online

    timtower Administrator Administrator Moderator

    @jakemaster2003 There is no actual ban event.
    Listen to the PlayerQuitEvent, then see if he / she is banned.
    But you can't clear the inventory or teleport for somebody that is offline. So you need to do that when they get online again after the ban.
     
  15. Offline

    jakemaster2003

    @timtower Also known as if a player quits because of a ban and remove their ncp violations and currency since i gues that works if a player is not online and if someone joins i have to get if he and she was banned i gues that i can do that with a arraylist?
     
  16. Online

    timtower Administrator Administrator Moderator

    @jakemaster2003 ArrayList would do, make sure to use the UUID though, not the name.
     
  17. Offline

    jakemaster2003

    I understand that @timtower


    *Update*

    Boom i need some help with setting the value of the balance i can ony withdraw and deposit but not setting it so how can i do that?
     
    Last edited: May 17, 2017
  18. Offline

    C.L.

    ...Or maybe it should put a delay before it bans the player just long enough so that it can clear them and then ban them.
     
  19. Online

    timtower Administrator Administrator Moderator

    @C.L. Then you would be modifying the ban plugin. Not something that is fun to do.
     
  20. Offline

    YoloSanta

  21. Offline

    Horsey

    @YoloSanta I'll do it, but I need the name of the world where you want the player to spawn
     
    Last edited: May 21, 2017
  22. Online

    timtower Administrator Administrator Moderator

    Config value?
     
  23. Offline

    Horsey

    Sure, I'll do that.
     
  24. Offline

    YoloSanta

    Can it be added in the config to change/add worlds ?
    If not main world is world
     
  25. Offline

    Horsey

    I'm done! You can specify the world you want the player to spawn, and the starting balance in the config. Just so you know, I added a feature so that you can also ban offline players, and it will work. For this, you need to set every how many minutes you want the server to scan for new bans in config under 'search-bans'.
    Here is a link to the plugin's jar: https://www.dropbox.com/s/pznfhkqrndjkdbh/BanClear.jar?dl=0
    And the source code (since you asked): https://hastebin.com/afomawayir.java
    Enjoy!
     
  26. Online

    timtower Administrator Administrator Moderator

    @Horsey Use getLogger().info / severe to log instead of sending messages to the console.
    Initialize config stuff in the onEnable, not in the fields.
     
  27. Offline

    Horsey

    @timtower I see.. I'll initialize stuff in the config next time, but why not just send a message to console? Does it make a difference?
     
  28. Online

    timtower Administrator Administrator Moderator

    @Horsey it does not show in the same logger, which is made for logging like this.
     
  29. Offline

    Horsey

Thread Status:
Not open for further replies.

Share This Page