Player Login time help

Discussion in 'Plugin Development' started by NeoSilky, Sep 13, 2011.

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

    NeoSilky

    Okay, so i'm doing a plugin request, and i need to find out the TOTAL time that the player has played on the server for. I have a onPlayerLogin and onPlayerQuit/onPlayerKick, but i need it so it logs the hour and minute they login, and the hour and minute they logout and then it would calculate their time and add it to previous times so it makes a total time that i could compare configurable string value's to, so it does more code :)

    Any ideas? :) Or if a dev could help, even better ;)

    EDIT: if i have to use BML, which may be easier, can someone teamviewer me to help? :)
     
  2. Offline

    stelar7

    value1 = time when they login
    value2 = time when they logout/leave/kicked
    value3 = amount they played this time
    currentvalue = the time they have played total

    value1 = System.getTimeCurrentMillis()
    value2= System.getTimeCurrentMillis()
    value1 - value2 = value3
    currentvalue = currentvalue + value3

    then write it to a config or a database
     
  3. Offline

    NeoSilky

    thank you!
     
Thread Status:
Not open for further replies.

Share This Page