21.06.2015, 09:22
Hello, i have a small system which save how many seconds a player stayed online, like this:
OnPlayerConnect:
pInfo[playerid][ConnectedTime]=gettime();
Load his seconds from account in variable pInfo[playerid][TotalSecs] as integer.
//--------------------------------------------------------------------------
When save player's statistics:
new seconds = gettime() - pInfo[playerid][ConnectedTime] + pInfo[playerid][TotalSecs];
Save variable seconds in player's account as integer.
Sometimes the line above (from save statistics) is not working. It returns a number of seconds like gettime(). Is there a problem with the integers? It exceeds any limit calculation (difference/amount of numbers)?
OnPlayerConnect:
pInfo[playerid][ConnectedTime]=gettime();
Load his seconds from account in variable pInfo[playerid][TotalSecs] as integer.
//--------------------------------------------------------------------------
When save player's statistics:
new seconds = gettime() - pInfo[playerid][ConnectedTime] + pInfo[playerid][TotalSecs];
Save variable seconds in player's account as integer.
Sometimes the line above (from save statistics) is not working. It returns a number of seconds like gettime(). Is there a problem with the integers? It exceeds any limit calculation (difference/amount of numbers)?