GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Segítségkérés => A témát indította: Live - 2013. március 27. - 15:09:38

Cím: TotalGameTime
Írta: Live - 2013. március 27. - 15:09:38
Ü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?
Cím: TotalGameTime
Írta: Mike. - 2013. március 27. - 15:40:38
//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;
}
Cím: TotalGameTime
Írta: Live - 2013. március 27. - 15:59:00
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];
}