Time and DB table updates when creating a mod!

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Time and DB table updates when creating a mod!

      Hello! I'm willing to create a some sort of lottery mod that has a general time and there are 2 types of lotteries that players can join. In each of them they can get points and the player with the most points when lottery_time expires wins.

      The question is where to put function that checks if lottery_time < timestamp and then add dark_matter to winner and reset whole table and add 3600s to lottery time? Should I write it in the cronjobs.php or can I write it in the page.php?
    • Thanks, but. The idea is a bit different it isn't like lottery and also I would like to understand coding better by doing it myself.

      Are the page.php functions loaded and executed only when somebody opens that page or am I wrong?
    • What would you suggest as the best way to ensure that functions work even if nobody visits that page? Can I somehow put in the cronjobs line that executes page.php if lottery_time < TIMESTAMP or is there a better way?