Banning a player

Discussion in 'Plugin Development' started by UruMoonshadow, Jan 20, 2011.

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

    UruMoonshadow

    Hi there,
    I am busy porting my two old hey0 mods to bukkit and was wondering if it's possible for bukkit to ban players yet?
     
  2. Offline

    UruMoonshadow

    No answers? I have looked through the current documentation and have not seen anything, but that does not mean it's not there.
     
  3. Offline

    MadMichi

  4. Offline

    UruMoonshadow

    I know you can kick them but if you fully read my original post you would see that I want to BAN people, not just kick them. I could just have the plugin keep kicking "banned" users but I'd rather be able to have the server stop them from connecting at all.
     
  5. Offline

    1337

    check if they are on your banlist when they are connecting if they are cancle the event? that might work
     
  6. Offline

    UruMoonshadow

    Thanks 1337 I will look into that. I was not aware that something like that was possible, I am used to using the etc.getServer().ban(name); from hey0
     
  7. Offline

    MadMichi

    Sorry i couldn't help you.
    As this plugin seems to be very complicated to install a ban functionality i'm afraid there is no ban in bukkit right now. :(
     
  8. Offline

    UruMoonshadow

    That one seems to be for a global ban list, rather than just a local one. I guess with that out there's not much need for my TempBan plugin any more.
     
  9. Offline

    1337

    try this
    Code:
    public void onPlayerlogin(PlayerLoginEvent event) {
    
            Player player = event.getPlayer();
            loginname = player.getName();
        // ifplayer on banlist {
    Setcanceld(true);
    }
        }
     
  10. Offline

    MadMichi

    I just tryed what 1337 suggested and it works as followed:

    Code:
    public void onPlayerLogin (PlayerLoginEvent event){
    // if on ban-list
    event.setResult(Result.KICK_BANNED);
    }
     
  11. Offline

    1337

    my idea sort of worked yay :) thanks for testing madmichi
     
  12. Offline

    UruMoonshadow

    Awesome, thanks everyone :) This solves my problem.
     
Thread Status:
Not open for further replies.

Share This Page