Server Uptime
Hello everyone,
i want to know if thats possible to get time format from GetGameTime(). I want to get days, hours, minutes, seconds and miliseconds. Thanks. :3 |
Re: Server Uptime
Code:
public OnPluginStart() Edit:return Plugin_Handled; |
Re: Server Uptime
@Doodil
Just one proposal: PHP Code:
Note that GetGameTime() does not count until there are/was players in the server. Yours sincerely Impact |
Re: Server Uptime
@Impact123 I know that its just server uptime, and not player session time. :)
But for player session time i just need to save the connect time and do (GetGameTime() - ConnectTime). Right? |
Re: Server Uptime
No he tried to say that GetGameTime() will return 0.0 as long as there hasn't been anyone on the server, and only start adding gametime once someone joins.
But yea, for the session time just save the time on connect and use GetGameTime()-ConnectionTime[client] to calculate |
Re: Server Uptime
@Privet1337
That should do what you want. @Doodil Yes, thats what i meant to say. Yours sincerely Impact |
Re: Server Uptime
Okay. Thank you guys :)
Anyway I wanted to know only about time formating. |
Re: Server Uptime
|
Re: Server Uptime
FormatTime() only works with a timestamp, GetGameTime() doesn't return a timestamp but the seconds as a float, so sadly you cant use that function in this case
|
Re: Server Uptime
if you want to get total server uptime, just have a plugin store GetTime() when it first initializes, just remember to format it as its stored in unix time
|
All times are GMT -4. The time now is 07:16. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.