Quote:
Originally Posted by bigdaddy424
Isn't this better that a looping task?
You got end var as current timeframe in seconds
Code:
public client_putinserver(){
new start = get_systime()
}
public client_disconnected(){
new end = get_systime() // this will read time when the user get disconnected
end -= start // so i need to return the time played when user disconnected but if is it the first time for the user it will be like this 0 -= join time and i think you know what this mean
}
|
You missed something read this again:
Quote:
I see this way is better than saves get_user_time so if i used that way it gonna be like this g_iPlayer[ id ][ Time_Played ] += get_user_time( id ) / 60 and i need to use this way everytime when return it
But using task for check the time every second when connected to the server is faster and better
|
Edit: There are some ways to get time played of the player
- This way: g_iPlayer[ id ][ Time_Played ] += get_user_time( id ) / 60
- The way that i used
- Your way, but you have an issue in your code it shuld be ( start -= end ) because if this is the first time player has connected to the server and tryed to check his time played will be like 0 -= start and this mean - num also with this way i gonna use get_systime() four times and this is not faster
__________________