29.11.2013, 17:48
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).
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).