Check if a player spent an hour online

Discussion in 'Plugin Development' started by HeavyMine13, Jun 22, 2014.

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

    HeavyMine13

    Hello! So I want to check if a logged on player has been online for an hour, but if he logs out, the timer pauses until he is back the timer will go on until it reaches an hour and reset! How can I do this, I tried hashmaps but didnt work with the logout pause! Please help!
     
  2. Offline

    NoLiver92

    You will have to get the time he logs in, time he logs out and save it. use a runnable to check time so that if the player is ingame it updates at the 1 hour mark otherwise it will only work when he logs out.
     
  3. Offline

    HeavyMine13

    So I figured out if he logs out it will do it, but how can I do it if he is ingame ? Thanks!
     
  4. Offline

    NoLiver92


    Did you not read? use a runnable/repeating task, after say 5 mins do a loop which scans all players and then inside that loop do the required check to get his total online time. then if its over the 1 hour do whatever you want
     
Thread Status:
Not open for further replies.

Share This Page