08.12.2014, 11:27
Hello Derexi,
You could create a column named connected_time (integer) (default to 0) inside your players table and save the data in seconds,
OnPlayerConnect you get the current time and set it to your players variable,
OnPlayerDisconnect you get the current time again and use to get the difference between the connect time and the current time, casting it to seconds, at the end just make sure to increment the value in the database when you save the player progress.
After that you could easyly create a command to show the time each player has been connected,
Hope it help you.
You could create a column named connected_time (integer) (default to 0) inside your players table and save the data in seconds,
OnPlayerConnect you get the current time and set it to your players variable,
OnPlayerDisconnect you get the current time again and use to get the difference between the connect time and the current time, casting it to seconds, at the end just make sure to increment the value in the database when you save the player progress.
After that you could easyly create a command to show the time each player has been connected,
Hope it help you.