[HELP]Saving Hours, Minutes, Seconds
#2

It would be a lot easier adding only hours. Set a timer to run once every hour and do
pawn Код:
PlayerInfo[playerid][hours]++;
The function gettime, doesn't get the time played, it gets the current time on the server. You can use the value it returns to calculate how many hours, minutes and seconds the player has been online.

https://sampwiki.blast.hk/wiki/Gettime

It returns the current hour, minute and second. Say that the server time is 8:21 PM (8:21:09) (Hour, Minutes, Seconds), it will return the value 8 for hour, 21 for minutes and 9 seconds.
If you get the time the player logs in, and then get it again when he logs out, you can calculate the time be's been online from that. Please note that you should get the date as well, so that it doesn't mistake it for being the same day.
Reply


Messages In This Thread
[HELP]Saving Hours, Minutes, Seconds - by ApOcAlYpSe98 - 22.03.2014, 12:26
Re: [HELP]Saving Hours, Minutes, Seconds - by Knappen - 22.03.2014, 13:14
Re: [HELP]Saving Hours, Minutes, Seconds - by Konstantinos - 22.03.2014, 13:51
Re: [HELP]Saving Hours, Minutes, Seconds - by Knappen - 22.03.2014, 17:01
Re: [HELP]Saving Hours, Minutes, Seconds - by Konstantinos - 22.03.2014, 20:27
Re: [HELP]Saving Hours, Minutes, Seconds - by Knappen - 22.03.2014, 20:29
Re: [HELP]Saving Hours, Minutes, Seconds - by Konstantinos - 22.03.2014, 20:39
Re: [HELP]Saving Hours, Minutes, Seconds - by Knappen - 22.03.2014, 21:51

Forum Jump:


Users browsing this thread: 3 Guest(s)