Checking the time.
#1

How can I check the time, I want a Paycheck system that is called every hour on the hour (My server uses a real-time system that uses the time of the server)
Sorry for a very blunt explanation, but it's just as simple as that and I don't know how to do it!
Any help is much appreciated and will +rep.
Reply
#2

Can you show me your real-time system?
Reply
#3

Quote:
Originally Posted by Macronix
Посмотреть сообщение
Can you show me your real-time system?
http://pastebin.com/dH6hpqw9
Thats the FS I'm using, although I've incorporated it into my gamemode, nothings changed.
Reply
#4

You could check with a one second timer and GetTickCount:

pawn Код:
//above main()
new tick, NextCheck;

//In OnGameModeInit:
SetTimer(....); // with 1 sec interval

//In your one second function being called by SetTimer:
tick = GetTickCount();
if(tick - NextCheck > 3600000) //3600000 = 1 hour
{

//your code... so calling a function (PayCheck) or something

NextCheck = tick;

}
Reply
#5

So, basically just make a timer, that is called every hour, I sorta wanted it to be on the hour, like 09, 10, 11, etc.. But I guess thats better than nothing! Would I be able to do something like if(minutes == 00) or something to represent the new hour? I'm really not sure >.>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)