02.08.2011, 03:36
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.
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
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; }
For some reason count restarts everytime i reconnect server, and it changed data in mysql