First i will Thank to
@Rocky and
@Thijn for an useful function
GetTimeFormatI know it isn't hard to made for us but it would be really hard to made for newbies so i made it :)
Main.nut
onScriptLoad()
{
Start <-0;
Start = time();
}
Command:
if (cmd=="hoston")
{
local time_taken = time()-Start;
Message("Server Host Time "+GetTimeFormat(time_taken));
}
function GetTimeFormat( secs )
{
local nDays, nHours, nMinutes, nMonths, nYears, nTime = "";
nYears = secs/31536000;
secs = secs%31536000;
nMonths = secs/2678400;
secs = secs%2678400;
nDays = secs/86400;
secs = secs%86400;
nHours = secs/3600;
secs = secs%3600;
nMinutes = secs/60;
secs = secs%60;
if( nYears != 0 ) nTime = nTime + nYears + " Year" + (nYears > 1 ? "s":"");
if( nMonths != 0 ) nTime = nTime + (nTime != "" ? ", ":"") + nMonths + " Month" + (nMonths > 1 ? "s":"");
if( nDays != 0 ) nTime = nTime + (nTime != "" ? ", ":"") + nDays + " Day" + (nDays > 1 ? "s":"");
if( nHours != 0 ) nTime = nTime + (nTime != "" ? ", ":"") + nHours + " Hour" + (nHours > 1 ? "s":"");
if( nMinutes != 0 ) nTime = nTime + (nTime != "" ? ", ":"") + nMinutes + " Minute" + (nMinutes > 1 ? "s":"");
if( secs != 0 ) nTime = nTime + (nTime != "" ? ", ":"") + secs + " Second" + (secs > 1 ? "s":"");
return nTime;
}
Update: Changed time() with GetTickCount()
Good Work
You should use the time() function for this. GetTickCount will stop working after your server has been online for 49.7 days, because of the millisecond accuracy. You're calculating with seconds anyways, so why do the extra calculation.
Good work.
If not DNUS
Nice work.
But SLC already did it in an easy way :)
@Thijn i changed to time but i cant test it atm so can you tell me that does it works
Probably, yes.
Great work.
does this mean we can host our server in the master list?
Quote from: Mr.Dip 2020 on Dec 16, 2020, 04:41 PMdoes this mean we can host our server in the master list?
You just bumped a 5 years old post to ask that?
._.
Host Time is the uptime to check the time since when the server is up / hosted.
To show your server in masterlist, you need announce plugin and port forwarded internet ( if local hosted ) or VPS
Quote from: Inferno on Dec 16, 2020, 06:35 PMQuote from: Mr.Dip 2020 on Dec 16, 2020, 04:41 PMdoes this mean we can host our server in the master list?
You just bumped a 5 years old post to ask that?
._.
Host Time is the uptime to check the time since when the server is up / hosted.
To show your server in masterlist, you need announce plugin and port forwarded internet ( if local hosted ) or VPS
O B V I O U S L Y
Quote from: Inferno on Dec 16, 2020, 06:35 PMQuote from: Mr.Dip 2020 on Dec 16, 2020, 04:41 PMdoes this mean we can host our server in the master list?
Host Time is the uptime to check the time since when the server is up / hosted.
To show your server in masterlist, you need announce plugin and port forwarded internet ( if local hosted ) or VPS
TOPIC LOCKED