Cooldown, with kick.

Discussion in 'Plugin Development' started by TheEyeMonster, Oct 4, 2013.

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

    TheEyeMonster

    I wan't to make a event cooldown, just a code that counts from 5 to 0 (in seconds) while called by the event, and if the event is getting repeated in that 5 seconds you get kicked.
     
  2. Offline

    3ptO

    Use a scheduler (.scheduleSyncDelayedTask) to create the cooldown.

    Before running the cooldown, add the player to a HashSet and after the cooldown remove the player.

    Code:java
    1. if (set.contains(name)) {
    2. //kick
    3. } else {
    4. //run cooldown
    5. }
     
    TheEyeMonster likes this.
  3. Offline

    1Achmed1

    If your player var is player, the kick code is player.setKicked(); or something.
     
  4. Offline

    Compressions

    1Achmed1
    Code:
    player.kickPlayer(message);
     
  5. Offline

    1Achmed1

    Lol, I dot usually handle that sort of stuff.
     
Thread Status:
Not open for further replies.

Share This Page