Every hour and half a hour
#21

Quote:
Originally Posted by GospodinX
Посмотреть сообщение
But where to use gettime? I don't understand.
try at OnPlayerUpdate(playerid)
Reply
#22

Quote:
Originally Posted by Florin48
Посмотреть сообщение
try at OnPlayerUpdate(playerid)
haha
Reply
#23

Quote:
Originally Posted by GospodinX
Посмотреть сообщение
But where to use gettime? I don't understand.
Check my code, that's exactly what you want. You can even put the timer to 10 seconds or 1 min, it's up to you how acurate you want it.
Reply
#24

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)