BeshoGraphix

Untitled

Jun 20th, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1.     @EventHandler
  2.     public void onLogin(PlayerLoginEvent e){
  3.         Player p = e.getPlayer();
  4.         int random = new Random().nextInt(Bukkit.getOnlinePlayers().length);
  5.         Player player = Bukkit.getOnlinePlayers()[random];
  6.        
  7.         if (e.getResult() == Result.KICK_FULL){
  8.             if (p.hasPermission("premium.join")){
  9.                 e.allow();
  10.                 if (!player.hasPermission("premium.join")){
  11.                     player.kickPlayer("You're kicked to let the premium players join the server");
  12.                 }
  13.                
  14.             }
  15.            
  16.            
  17.         }
  18.        
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment