Hello all,
So, i am creating a game where i want all users to be able and click a button once per day. Once the button is clicked, they will get a result out of this and then they can press it again after 24 hours from the last time they pressed it.
So my question is: How is it possible to prevent a user from pressing the button again before the 24 hours have passed for him?
For example: I press at 3AM.
User 1 presses at 3:15AM.
I willl be able to press the button again at 3am the next day and user 1 at 3:15am the next day. Now if the next day i press it at 6am then i'll have to wait the next day till 6am.
I have an idea on how to do this but i believe i need to do cache control for the 24 hour span time and i don't know how to do this.
Big Plan:
A green button. Once pressed, turns gray and not able to press it, after 24 hours turns green and can be pressed to work the game i want.
( So easy to write down in words, so difficult to code, at least for me.. )
Any help would be appreciated. Thanks!
So, i am creating a game where i want all users to be able and click a button once per day. Once the button is clicked, they will get a result out of this and then they can press it again after 24 hours from the last time they pressed it.
So my question is: How is it possible to prevent a user from pressing the button again before the 24 hours have passed for him?
For example: I press at 3AM.
User 1 presses at 3:15AM.
I willl be able to press the button again at 3am the next day and user 1 at 3:15am the next day. Now if the next day i press it at 6am then i'll have to wait the next day till 6am.
I have an idea on how to do this but i believe i need to do cache control for the 24 hour span time and i don't know how to do this.
Big Plan:
A green button. Once pressed, turns gray and not able to press it, after 24 hours turns green and can be pressed to work the game i want.
( So easy to write down in words, so difficult to code, at least for me.. )
Any help would be appreciated. Thanks!