Advertisement
mattibijnens

Untitled

Aug 28th, 2014
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. public static int getTimeLeft(Player p, int questID) {
  2.         int lastUse = 0;
  3.         int timeNow = (int) System.currentTimeMillis();
  4.         int timeLeft = 0;
  5.         if (questID == 1) {
  6.             lastUse = Quest1CD.get(p);
  7.         }
  8.         if (questID == 2) {
  9.             lastUse = Quest2CD.get(p);
  10.         }
  11.         if (questID == 3) {
  12.  
  13.             lastUse = Quest3CD.get(p);
  14.             timeLeft = (int) TimeUnit.SECONDS.convert(
  15.                     (60 * 60 * 48)
  16.                             - TimeUnit.SECONDS.convert(timeNow - lastUse,
  17.                                     TimeUnit.MILLISECONDS),
  18.                     TimeUnit.MILLISECONDS);
  19.  
  20.         }
  21.  
  22.         return timeLeft;
  23.  
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement