18.07.2018, 12:27
Hi guys
I want to make timer with which I will be able to do some thing every hour and half a hour.
For example( 00:00 00:30 01:00 01:30 02:00 ... 06:00 06:30 etc )
I want to start an race event in 00:00 ,in 00:30 i want to start derby event etc...it's example.
I'm use this:
Now,problem is that sometimes happend that timer omissions some hour.
If timer is called in 02:59:59 and next time in 03:01:01 i can't do anything in 03:00 ..Because my code don't will work in it case.
Do you have any better suggestion?
I want to make timer with which I will be able to do some thing every hour and half a hour.
For example( 00:00 00:30 01:00 01:30 02:00 ... 06:00 06:30 etc )
I want to start an race event in 00:00 ,in 00:30 i want to start derby event etc...it's example.
I'm use this:
Код:
task OneMinuteTimer[60000]() { new hours,minutes,seconds; gettime(hours,minutes,seconds); if(minutes == 30) { if(hours == 1) { //This is 01:30 } else if(hours == 2) { //This is 02:30 } else if(minutes == 0) { if(hours == 1) { //This is 01:00 } else if(hours == 2) { //This is 02:00 } } return 1; }
If timer is called in 02:59:59 and next time in 03:01:01 i can't do anything in 03:00 ..Because my code don't will work in it case.
Do you have any better suggestion?