PDA

View Full Version : My time clock sometimes jumps a few seconds..


Dokins
05/12/2013, 03:53 AM
With the clock seconds jumping every 8-10 seconds and dialog taking a while to open, would anyone have any idea why this might be?


public UpdateTimeAndWeather()
{
gettime(hour, minute, seconds);
if(minute == 0) SetWorldTime(hour);
if (hour > 23) hour = 0;

format(timestr,32,"%02d:%02d:%02d", hour, minute, seconds);
TextDrawSetString(txtTimeDisp,timestr);

foreach(Player, i)
{
if(IsPlayerConnected(i) && LoggedIn[i] == 1)
{
SetPlayerTime(i,hour+2,minute);
if(minute == 0 && seconds == 00)
{
doPayDay(i);
}
}
}
return 1;
}



this is a clock.

The only timers are run every minute and are all based on player variables, not on general server.

Pottus
05/12/2013, 06:56 AM
Your probably not using the timerfix http://forum.sa-mp.com/showthread.php?t=289675 so your timers are too slow.