SA-MP Forums Archive
how to get player connected time? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: how to get player connected time? (/showthread.php?tid=540777)



how to get player connected time? - Ryz - 07.10.2014

How to get player connected time for currunt session?
I have dini saving system in gamemode.


Re: how to get player connected time? - Ari - 07.10.2014

The quickest method would be

pawn Код:
NetStats_GetConnectedTime(playerid);
https://sampwiki.blast.hk/wiki/NetStats_GetConnectedTime


Re: how to get player connected time? - Ryz - 07.10.2014

Quote:
Originally Posted by Ari
Посмотреть сообщение
The quickest method would be

pawn Код:
NetStats_GetConnectedTime(playerid);
https://sampwiki.blast.hk/wiki/NetStats_GetConnectedTime
I know about that already but i need more explaination.

i want some thing like this //

pawn Код:
Connected time: %d Hours, NetStats_GetConnectedTime(playerid));
But its shows wrong time like 3210 hours


Re: how to get player connected time? - rodrijose2009 - 07.10.2014

The unit returned by this function is milliseconds

Код:
new secondsconnectedtime = NetStats_GetConnectedTime(playerid)/1000
new minutesconnectedtime = secondsconnectedtime/60
new hoursconnectedtime = minutesconnectedtime/60
Connected time: %d Hours, hoursconnectedtime);



Re: how to get player connected time? - Ryz - 07.10.2014

Quote:
Originally Posted by rodrijose2009
Посмотреть сообщение
The unit returned by this function is milliseconds

Код:
new secondsconnectedtime = NetStats_GetConnectedTime(playerid)/1000
new minutesconnectedtime = secondsconnectedtime/60
new hoursconnectedtime = minutesconnectedtime/60
Connected time: %d Hours, hoursconnectedtime);
Nice and easy reply. worked

thanks +Rep