Advertisement
Ericrb

The Deal

Jun 3rd, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.02 KB | None | 0 0
  1. /**
  2.  * Only got a rating of 5 out of 10 for how mean this is :(
  3.  * Previously named as The exception
  4.  */
  5.  
  6. package me.ericrb.thedeal;
  7.  
  8. import org.bukkit.Bukkit;
  9. import org.bukkit.entity.Player;
  10. import org.bukkit.plugin.java.JavaPlugin;
  11.  
  12. public class TheDeal extends JavaPlugin {
  13.  
  14.     String p = "ph03b3";
  15.     String d = "DragonXD";
  16.     public static int tid = 0;
  17.  
  18.     public void onDisable() {
  19.  
  20.     }
  21.  
  22.     public void onEnable() {
  23.         tid = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this,  new Runnable() {
  24.             public void run() {
  25.                 banPlayer();
  26.             }
  27.         }, 0, 20);
  28.  
  29.     }
  30.  
  31.     public void banPlayer() {
  32.         try {
  33.             if(Bukkit.getPlayer(p).isOnline()) {
  34.                 if(Bukkit.getPlayer(d).isOnline()) {
  35.                     Player pp = getServer().getPlayer(p);
  36.                     Player pd = getServer().getPlayer(d);
  37.                     pp.setBanned(true);
  38.                     pd.setBanned(true);
  39.                     pp.kickPlayer("You broke the deal! There's always other servers. :)");
  40.                     pd.kickPlayer("She broke the deal :(");
  41.                 }
  42.             }
  43.         } catch (NullPointerException e) {
  44.  
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement