17.07.2016, 14:07
Hey i have a bug in player stats (played time) the time increases by 160 hours or smthing after a minutes from register
when player register the time is working good but after few minutes it gets bugged.
thats the code of how it should count the played time i guess its the wrong one
also under onplayerconnect
PInfo[playerid][ConnectTime] = gettime();
when player register the time is working good but after few minutes it gets bugged.
Код:
TotalGameTime(playerid, &h=0, &m=0, &s=0) { PInfo[playerid][TotalTime] = ( (gettime() - PInfo[playerid][ConnectTime]) + (PInfo[playerid][hours]*60*60) + (PInfo[playerid][mins]*60) + (PInfo[playerid][secs]) ); h = floatround(PInfo[playerid][TotalTime] / 3600, floatround_floor); m = floatround(PInfo[playerid][TotalTime] / 60, floatround_floor) % 60; s = floatround(PInfo[playerid][TotalTime] % 60, floatround_floor); return PInfo[playerid][TotalTime]; }
also under onplayerconnect
PInfo[playerid][ConnectTime] = gettime();