27.07.2018, 10:45
Every hour and half a hour
27.07.2018, 11:04
27.07.2018, 15:03
27.07.2018, 20:57
Run a 1 second timer to be accurate, then check if "minute" is 0 or 30 and a flag is 0.
If so, execute your stuff and set the flag to 1.
To reset the flag, add a second if-statement to check if "minute" is 1 or 31, if so, set the flag back to 0.
This flag blocks your stuff to be executed 60 times per minute.
And your code gets executed within one second after the time reaches "minute" 0 or 30.
Florin48 provided an example of such a flag.
To retrieve the current hour, minute and second using gettime, check this:
https://sampwiki.blast.hk/wiki/Gettime
And doing it with just checking for "minute" 0 or 30 and the flag, you don't even need to check for the hour, unless you want to skip certain hours.
If so, execute your stuff and set the flag to 1.
To reset the flag, add a second if-statement to check if "minute" is 1 or 31, if so, set the flag back to 0.
This flag blocks your stuff to be executed 60 times per minute.
And your code gets executed within one second after the time reaches "minute" 0 or 30.
Florin48 provided an example of such a flag.
To retrieve the current hour, minute and second using gettime, check this:
https://sampwiki.blast.hk/wiki/Gettime
And doing it with just checking for "minute" 0 or 30 and the flag, you don't even need to check for the hour, unless you want to skip certain hours.
« Next Oldest | Next Newest »
Users browsing this thread: 3 Guest(s)