SA-MP Forums Archive
Time bug. Please help! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Time bug. Please help! (/showthread.php?tid=88255)



Time bug. Please help! - bpeterson - 25.07.2009

Hello Everyone!

I have this code:
http://pastebin.com/m41bedf5e

But there is a bug. When it's Tuesday, the hour won't be zeroed. It's flashing, because it's sync the time in every 1sec.

For example:

25:01 then sync it - 01:02

I hope you understand it ^^

Please help me! Thanks.

bpeterson


Re: Time bug. Please help! - bpeterson - 25.07.2009

bump


Re: Time bug. Please help! - paytas - 25.07.2009

pawn Код:
new d, h, m, weekdays[][] = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };

public TimeUpdate()
{
  if (m > 59) m = 0, h ++;

  if (h > 23) h = 0, d ++;
   
  if (d > 6) d = 0;
     
  printf("[TimeUpdate] %s, %02d:%02d", weekdays[d], h, m);

  for (new i = 0; i < MAX_PLAYERS; i ++) SetPlayerTime(i, h, m);

  m ++;
}