How to ban players?

Discussion in 'Plugin Development' started by Walnoot, Dec 23, 2011.

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

    Walnoot

    I'm trying to make a plugin that bans players for a few hours, but I don't know the method in the Bukkit API that bans players.

    Edit: It's solved now, thanks Chiller!
     
  2. Offline

    Chiller

    player.setBanned(true);
     
  3. Offline

    Walnoot

    Thanks a lot!
     
  4. Offline

    Jaker232

    Instead of doing that, you could loop in the syncing task that you can minus one for each int in a database so if someone was banned for 30 seconds, every tick would remove 1 (20 ticks per second, so it's 600 ticks). If int equals 0 then return and do not subtract.
     
  5. Offline

    unicode21B9

    Very inefficient and completely useless. I'd simply unban a player if the ban peroid expired when the player tries to log in.
     
  6. Offline

    ItsHarry

    Here's what you should really do:
    When you ban a player, save the date using JAVA's Date class and add a certain amount of time to it, for example 3 days. When he tries and log in, see if the current date has passed that date. If yes, unban him. If not, do nothing.

    EDIT by Silentspy: Please don't insult people in your post, it only make you look bad. we all try to be friendly to each other here.
     
Thread Status:
Not open for further replies.

Share This Page