- Home /
Lottery system than can be use once a day
Hello i'm just wandering if there's a way to make a lottery system but only can be spin once a day? and wait until tomorrow / 12 aclock by not using computer time?, because you can change time in computer and i will effect the lottery system, and the time will still going even tough pc is not on
Answer by Slobdell · Aug 12, 2013 at 04:29 PM
Have it check a time that's always the same, like time on your server/database or find a time API you tap into like http://www.timeanddate.com/services/api/time-api.html
Answer by Xtro · Aug 12, 2013 at 04:32 PM
in the Update event, add the deltatime to a global variable. Check if this variable reached a predefined value(60 x 60 x 24 = a day in seconds). if it reached than reset it and do one spin.
If you store this variable on disc and reload it back on application restarts, it won't count the time when computer was off.
Your answer