Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question about tracking usage

Comments in 'Plugin Development' started by daviskingdom, Mar 19, 2015.

  1. daviskingdom
    Offline

    daviskingdom New Member

    Joined:
    Mar 19, 2015
    Posts:
    2
    I am curious to write a plugin which tracks time a player has been in a world.

    1- record when each player connects
    2-tell them they played when they send a custom command (ie /timeonline)

    I am stuck on getting the time a player connects. I *think* I understand how to do #2.

    Can you suggest how to start writing #1?
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Initialize an array field, set the key as $player->getId() and value as time() or microtime(true)
    Andrey Nazarchuk and EvolSoft like this.
  3. daviskingdom
    Offline

    daviskingdom New Member

    Joined:
    Mar 19, 2015
    Posts:
    2
    Thank you. Works perfectly

Share This Page

Advertisement