getLastPlayed() Help

Discussion in 'Plugin Development' started by slater96, Jul 19, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    slater96

    I want to see if the time a player last played was within a week ago. How would I do this?
     
  2. Offline

    pzxc

    Make a PlayerQuitEvent listener that records the current time whenever a player logs out (saved to a config file, not just a variable, so that it persists through server restarts)

    Add the same thing in the onDisable function but does it for all online players

    Then when you want to find out how long since they've been on, get the diff between the current time and the time recorded for that player
     
  3. you need to look out when the system time chances, like if the cmos batery run dry, the time might reset to the past and messing up some future calls after the time is back
     
Thread Status:
Not open for further replies.

Share This Page