mrgrim333 Posted June 6, 2009 Share Posted June 6, 2009 So I have a game that I want to limit people's turns per day. They will have 5 coins per day. If they hit zero, they're cut off. If they don't use their 5, it doesn't accumulate, just resets. I want the value to reset every day at 12am. How the hell can I do this? ??? Quote Link to comment Share on other sites More sharing options...
ohdang888 Posted June 6, 2009 Share Posted June 6, 2009 have a mysql table named "coins" and track how many coins a user has left....if they are logged in, use their user id, if there is no login, use their ip address and cookies Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted June 7, 2009 Share Posted June 7, 2009 crontab Quote Link to comment Share on other sites More sharing options...
mrgrim333 Posted June 7, 2009 Author Share Posted June 7, 2009 The host I'm with doesn't allow cron Is there any work around? Quote Link to comment Share on other sites More sharing options...
fantomel Posted June 7, 2009 Share Posted June 7, 2009 the solution i would choose would be using mysql and add few more tables then just coins.. to keep track of the actions made by a user.. how many coins and stuff like that.. been used left.. depends on what you want. Quote Link to comment Share on other sites More sharing options...
DarkSuperHero Posted June 7, 2009 Share Posted June 7, 2009 use the server time time to see how long it has been since 12am... compare how many coins have been used since 12am.... if none have been used since 12am, allow 5 coins(reset) Check the time with every user.... :-) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.