PlayTime
#8

Of course you can!

You have 2 variables:
A for saving the total time.
B for storing the unix timestamp when a player logins.

When a player logins, you get the unix timestamp by using gettime() and assigning it to B. So you can save the total time when a player disconnects.

A += gettime() - B;

A was assigned the total time (previous times in seconds + seconds from the last visit).
Reply


Messages In This Thread
PlayTime - by kalanerik99 - 29.11.2013, 17:07
Re: PlayTime - by xVIP3Rx - 29.11.2013, 17:11
Re: PlayTime - by Konstantinos - 29.11.2013, 17:12
Re: PlayTime - by kalanerik99 - 29.11.2013, 17:25
Re: PlayTime - by kalanerik99 - 29.11.2013, 17:33
Re: PlayTime - by xVIP3Rx - 29.11.2013, 17:43
Re: PlayTime - by kalanerik99 - 29.11.2013, 17:47
Re: PlayTime - by Konstantinos - 29.11.2013, 17:48
Re: PlayTime - by kalanerik99 - 29.11.2013, 18:05
Re: PlayTime - by Konstantinos - 29.11.2013, 18:11

Forum Jump:


Users browsing this thread: 2 Guest(s)