Function to run on each hour
#4

Quote:
Originally Posted by blackeagle1122
Посмотреть сообщение
Create a timer that checks once a second (or use an existing one) save current hour to a variable with gettime() then call your function if the hour is changed.
I don't particularly want to have a timer that's running a function every second in all honesty, it's only going to slow things down.

Quote:
Originally Posted by Nin9r
Посмотреть сообщение
Something like that?

public SyncTime()
{
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
{
ghour = tmphour;
if (realtime)
{
SetWorldTime(tmphour);
}
}
return 1;
}

And use SyncTime(); to another timer.
Sorry but that doesn't really explain much to me. Where is ghour coming from? WHere did FixHour() come from? Where did shift hour come from?

Thanks
Reply


Messages In This Thread
Function to run on each hour - by Jonesy96 - 06.06.2016, 09:06
Re: Function to run on each hour - by blackeagle1122 - 06.06.2016, 09:36
Re: Function to run on each hour - by Nin9r - 06.06.2016, 09:53
Re: Function to run on each hour - by Jonesy96 - 06.06.2016, 10:10
Re: Function to run on each hour - by iggy1 - 06.06.2016, 10:22
Re: Function to run on each hour - by Abagail - 06.06.2016, 10:53
Re: Function to run on each hour - by Unte99 - 06.06.2016, 11:11
Re: Function to run on each hour - by Jonesy96 - 06.06.2016, 11:17

Forum Jump:


Users browsing this thread: 1 Guest(s)