Szerző Téma: TotalGameTime  (Megtekintve 834 alkalommal)

Nem elérhető Live

  • 507
    • Profil megtekintése
TotalGameTime
« Dátum: 2013. Március 27. - 15:09:38 »
0 Show voters
Üdv!
 
TotalGameTime(playerid, &h=0, &m=0, &s=0)
{
    NGStatics[playerid][totaltime] = ( (gettime() - NGStatics[playerid][connecttime]) + (NGStatics[playerid][hours]*60*60) + (NGStatics[playerid][minutes]*60) + (NGStatics[playerid][seconds]) );
    h = floatround(NGStatics[playerid][totaltime] / 3600, floatround_floor);
    m = floatround(NGStatics[playerid][totaltime] / 60,   floatround_floor) % 60;
    s = floatround(NGStatics[playerid][totaltime] % 60,   floatround_floor);
    return NGStatics[playerid][totaltime];
}

 
Van nekem ez a kódom, de nincs benne a nap és a hét.
Hozzátudja valaki írni, hogy legyen \"nap\" és \"hét\" is?

Nem elérhető Mike.

  • 720
    • Profil megtekintése
TotalGameTime
« Válasz #1 Dátum: 2013. Március 27. - 15:40:38 »
0 Show voters
//By Pedró
stock TotalGameTime(playerid, &w, &d, &h, &m, &s) {
new total = ((gettime() - NGStatics[playerid][connecttime]) + (NGStatics[playerid][hours]*60*60) + (NGStatics[playerid][minutes]*60) + (NGStatics[playerid][seconds]));
    w = total/604800; total = total - h*604800;
    d = total/86400; total = total - h*86400;
    h = total/3600; total = total - h*3600;
    m = total/60; total = total - m*60;
    s = total;
}

Nem elérhető Live

  • 507
    • Profil megtekintése
TotalGameTime
« Válasz #2 Dátum: 2013. Március 27. - 15:59:00 »
0 Show voters
TotalGameTime(giveplayerid, w, d, h, m, s);

 
hibát észlel..
 
error 017: undefined symbol \"w\"

 

TotalGameTime(playerid, &w=0, &d=0, &h=0, &m=0, &s=0)
{
    NGStatics[playerid][totaltime] = ( (gettime() - NGStatics[playerid][connecttime]) + (NGStatics[playerid][hours]*60*60) + (NGStatics[playerid][minutes]*60) + (NGStatics[playerid][seconds]) );
    w = floatround(NGStatics[playerid][totaltime] / 604800, floatround_floor);
    d = floatround(NGStatics[playerid][totaltime] / 86400, floatround_floor);
    h = floatround(NGStatics[playerid][totaltime] / 3600, floatround_floor);
    m = floatround(NGStatics[playerid][totaltime] / 60,   floatround_floor) % 60;
    s = floatround(NGStatics[playerid][totaltime] % 60,   floatround_floor);
    return NGStatics[playerid][totaltime];
}

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal