Database Values For User Return After Prolonged Amount Of Time?
So I have values in my database e.g. stamina, max_stamina, …
What I want to do is this:
If stamina is < max_stamina then
after 60 seconds stamina=stamina+1
else
nothing
I will need to loop this untill stamina equals max_stamina
I can easily create up the if statement, the problem I need help with is coding the 60 seconds, how could i go about it?
All so this will need to run when the player is and isnt logged in.
take a look at mysql events and schedules think that is what you are looking for. Also if you are having more than 1 users it would be smart to update them all in that 60 seconds interval you need.