Ü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?
//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;
}
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];
}