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
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
@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.
@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).
Those are good commands and permissions those would work for me! Great! Im guessing C.L. is gonna work on it? Not sure
@YoloSanta C.L. isn't a developer as far as I know. @jakemaster2003 Looks easy to use, might be a nice one for you
@timtower @YoloSanta Is this the plugin? https://dev.bukkit.org/projects/maxbans and so yes Timtower wich What is the best option for me to get the ban trigger an event or something else?
@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.
@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?
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?
...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.
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!
@Horsey Use getLogger().info / severe to log instead of sending messages to the console. Initialize config stuff in the onEnable, not in the fields.
@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?