Help with a timer and save.
#1

Hey, so i'm using Mysql and i want my players to see how long they have played on my server, so what i did was i created another variable, and everything went smooth, i went ingame and everything started going, i could see how many hours minutes and seconds i play.

Here is the problem, after i exit server, and come back on. a whole new timer starts, and the problem is Mysql records everything, but then my code tells it to restart whole thing, so here is a part of my code, I want to know why does it restart everytime i reconnect.


This is a timer.

Код:
syncserver = SetTimer("SyncServer", 999, 1);
Код:
forward SyncServer (playerid );
public SyncServer(playerid )
{

    PVar[playerid][pHours] ++;

    return 1;
}
once, again is there anything wrong with it? Mysql records how many seconds, and then its converted into minutes with some basic math.

For some reason count restarts everytime i reconnect server, and it changed data in mysql
Reply


Messages In This Thread
Help with a timer and save. - by Rocketeer - 02.08.2011, 03:36
Re: Help with a timer and save. - by PGTips - 02.08.2011, 03:41
Re: Help with a timer and save. - by Blacklite - 02.08.2011, 03:49
Re: Help with a timer and save. - by Rocketeer - 02.08.2011, 04:18
Re: Help with a timer and save. - by Rocketeer - 02.08.2011, 04:59

Forum Jump:


Users browsing this thread: 1 Guest(s)