stoneharry

Untitled

Apr 29th, 2012
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1.         if (!p.hasPermission("stoneharry.freetalk"))
  2.         {
  3.             long sent = System.currentTimeMillis();
  4.             long lasttime = lastmessage.get(p.getName());
  5.             if (lasttime != 0)
  6.             {
  7.                 int result = (int)(sent-lasttime);
  8.                 if (result < 60)
  9.                 {
  10.                     chat.setCancelled(true);
  11.                     p.sendMessage(ChatColor.RED + "You must wait " + ChatColor.AQUA + String.valueOf(result) + ChatColor.RED + " more seconds before you can send a message again.");
  12.                 }
  13.             }
  14.             else
  15.             {
  16.                 lastmessage.put(p.getName(), sent);
  17.             }
  18.         }
Advertisement
Add Comment
Please, Sign In to add comment