deathban

Discussion in 'Plugin Development' started by Harmings, Aug 9, 2013.

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

    Harmings

    At the moment i'm working on a deathban plugin, here's my code so far - http://pastebin.com/H971sqnN I was wondering how I could remove the player in the hashmap after 60 seconds
     
  2. Offline

    Xx_LeetGamer_xX

    Try this:

    Code:
    public void removePlayer(Player p, int seconds){
        removePlayer(p.getName(), seconds);
    }
    
    public void removePlayer(final String name, int seconds){
        Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable(){
            public void run(){
                ban.remove(name);
            }
        }, seconds * 20);
    }
    
     
  3. Offline

    Harmings

    It didn't work, I got kicked from the game when I died but I was never able to join back
     
  4. Offline

    Xx_LeetGamer_xX

    Oops, make sure that the "this" I put in there is an instance of the plugin.
     
  5. Offline

    Harmings

    Like this?
    Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
    This isn't working for me either
     
  6. Offline

    DrTURTLE2

    Fuck you harmings nerd.
     
  7. Offline

    Harmings

    0-0
     
  8. Offline

    Xx_LeetGamer_xX

    Any exceptions or any kind?
     
  9. Offline

    Harmings

    No, I just go in-game and die and then I wait a few minutes and I still cant join back
     
Thread Status:
Not open for further replies.

Share This Page