Server/Console | Time bug
#1

Okay, I've tested one time script and every second console needs to print currently time.
And I don't know, every 10 seconds, 1 second missing (sorry for bad English). You can look at the code and you will see where
is the problem.

Код:
[20:56:11] 20:56:11
[20:56:13] 20:56:13
[20:56:11]/[20:56:13] are normal 'log time' included in server console and 20:56:11/20:26:13 are my 'print time'.
I don't know why [20:56:12] and 20:56:12 is missing.

Here's the pawn code using for 'print time'.
pawn Код:
#include <a_samp>

main(){ SetTimer("atTime",1000,0); }
forward atTime();

public atTime()
{
    new iHour,iMinute,iSecond;
    new string[64];
   
    gettime(iHour,iMinute,iSecond);
   
    format(string,sizeof(string),"%d:%d:%d",iHour,iMinute,iSecond);
    print(string);
   
    SetTimer("atTime",1000,0);
    return 1;
}
I don't see any error in my code.


Again,sorry for bad English.
Reply
#2

It's not an exact science, timers. It's to do with tick counts, and well...

Код:
[22:55:18] 22:55:18
[22:55:19] 22:55:19
[22:55:20] 22:55:20
[22:55:21] 22:55:21
[22:55:23] 22:55:23
[22:55:24] 22:55:24
[22:55:25] 22:55:25
[22:55:26] 22:55:26
[22:55:27] 22:55:27
[22:55:28] 22:55:28
[22:55:29] 22:55:29
[22:55:30] 22:55:30
[22:55:31] 22:55:31
[22:55:33] 22:55:33
[22:55:34] 22:55:34
[22:55:35] 22:55:35
[22:55:36] 22:55:36
[22:55:37] 22:55:37
[22:55:38] 22:55:38
[22:55:39] 22:55:39
[22:55:40] 22:55:40
[22:55:41] 22:55:41
[22:55:42] 22:55:42
[22:55:44] 22:55:44
[22:55:45] 22:55:45
[22:55:46] 22:55:46
[22:55:47] 22:55:47
[22:55:48] 22:55:48
[22:55:49] 22:55:49
[22:55:50] 22:55:50
[22:55:51] 22:55:51
[22:55:52] 22:55:52
[22:55:54] 22:55:54
[22:55:55] 22:55:55
[22:55:56] 22:55:56
[22:55:57] 22:55:57
[22:55:58] 22:55:58
[22:55:59] 22:55:59
[22:56:00] 22:56:00
[22:56:01] 22:56:01
[22:56:02] 22:56:02
[22:56:04] 22:56:04
[22:56:05] 22:56:05
[22:56:06] 22:56:06
[22:56:07] 22:56:07
[22:56:08] 22:56:08
[22:56:09] 22:56:09
[22:56:10] 22:56:10
[22:56:11] 22:56:11
[22:56:12] 22:56:12
[22:56:13] 22:56:13
[22:56:15] 22:56:15
[22:56:16] 22:56:16
[22:56:17] 22:56:17
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)