spenk

JailDelay

Mar 15th, 2012
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.07 KB | None | 0 0
  1.  
  2. public class JailDelay {
  3.     int x;
  4.     int y;
  5.     int z;
  6.     int x1;
  7.     int y1;
  8.     int z1;
  9.     public void wait(final String playername, final int time, final String coordsjail , final String coordsfree){
  10.     new Thread() {
  11.      Player p =  etc.getServer().matchPlayer(playername);
  12.          public void run() {
  13.               try{
  14.                     String[] split = coordsjail.split(",");
  15.                    try{ x = Integer.valueOf(split[0]); y = Integer.valueOf(split[1]); z = Integer.valueOf(split[2]);}catch(NumberFormatException nfe){return;}
  16.                     p.switchWorlds(0);
  17.                     p.teleportTo(x,y,z, 0, 0);
  18.                     Thread.sleep(time);
  19.                     String[] split1 = coordsfree.split(",");
  20.                    try{ x1 = Integer.valueOf(split1[0]); y1 = Integer.valueOf(split1[1]); z1 = Integer.valueOf(split1[2]);}catch(NumberFormatException nfe){return;}
  21.                     p.switchWorlds(0);
  22.                     p.teleportTo(x,y,z, 0, 0);
  23.  
  24.               }catch(InterruptedException e) {p.sendMessage("§4o.o an error occured report it to an admin");}
  25.          }
  26.     }.start();
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment