Posts: 727
Threads: 111
Joined: May 2011
Reputation:
0
Hey guys I've been having issues with using gettime and I'm wondering that whenever gettime is used is it getting the time from the players computer or the hosting computer?
With totaltime you are getting gettime value which is seconds passed since 19.. , use 'm' in send client message instead of total time.
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Order of operations! Division has higher precedence than subtraction. You need to use brackets so the subtraction happens before the division. Also you don't need the h, m and s variables if you are solely looking to get the timestamp. You can use the function without parameters.
Posts: 727
Threads: 111
Joined: May 2011
Reputation:
0
Awesome thank you! I also have another question. When saving displaying time or dates, do I have to use %02d or can I just use %d. Also what does %02d do?
Apparently GetConnectedTime doesn't work on disconnect or timeout or something like that.
Posts: 217
Threads: 42
Joined: Aug 2016
Reputation:
0
02d 's "0" idk "2" might be for 2 num."d" is specifier
Posts: 4,759
Threads: 33
Joined: Dec 2013
Reputation:
0
%02d will place a 0 if the value is a single digit.
7 = 07
17 = 17
%07d:
7 = 0000007
5000 = 0005000
-----------------
I'm not sure if it works under OnPlayerDisconnect, but try by debugging:
printf("%d", (NetStats_GetConnectedTime(playerid) / 1000));