Szerző Téma: Mióta fút a szerver?  (Megtekintve 700 alkalommal)

Mióta fút a szerver?
« Dátum: 2013. május 07. - 22:20:58 »
0 Show voters
JÓ estét!

Abban kérnék segítséget, hogy sehol se találok olyan code-t/filterszkriptet ami jelzi mindig hogy \'\'Mióta fút a szerver\'\'


Aki segítene megköszönném!

Nem elérhető .:Secur:.

  • 2430
  • GTA Hero
    • Profil megtekintése
Mióta fút a szerver?
« Válasz #1 Dátum: 2013. május 07. - 22:24:50 »
0 Show voters
Angol fórum: samp server uptime
http://forum.sa-mp.com/showthread.php?t=187062
 
new StartTime;
// Put this line in OnGameModeInit:
StartTime = gettime();
// Put this function somewhere in the script and call it while formating a string (Example: format(string, sizeof(string), \"The server has been online for %s.\", GetUptime());
stock GetUptime()
{ // Thanks to JernejL @ sa-mp.scripting for the maths
    new Result[45],
        Remaining = gettime()-StartTime,
        Time[4];
    Time[0] = Remaining % 60; // Seconds
    Remaining /= 60;
    Time[1] = Remaining % 60; // Minutes
    Remaining /= 60;
    Time[2] = Remaining % 24; // Hours
    Remaining /= 24;
    Time[3] = Remaining; // Days
    if(Time[3])
        format(Result, 45, \"%d days, %d hours, %d minutes and %d seconds\", Time[3], Time[2], Time[1], Time[0]);
    else if(Time[2])
        format(Result, 45, \"%d hours, %d minutes and %d seconds\", Time[2], Time[1], Time[0]);
    else if(Time[1])
        format(Result, 45, \"%d minutes and %d seconds\", Time[1], Time[0]);
    else
        format(Result, 45, \"%d seconds\", Time[0]);
    return Result;
}

Mióta fút a szerver?
« Válasz #2 Dátum: 2013. május 07. - 22:25:59 »
0 Show voters
Köszi, de azt megtudnád csinálni hogy elmentse?

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal