Posted 01 September 2006 - 10:12 PM
I have a small project, but my knowlege on MKTime(); and time(); is
pretty crap, could someone help me brush my skills on this.
Basically I am designing a small online text based game (un-original i know)
And for every 5 minutes i wanted a character to lose 1% hunger. but
I don't know what to do. My guess is...
To time stamp during the logged in time, and everytime the user views a page
the time stamp is updated, and then using mktime() (somehow)
take the time stamp, and check the current time if the current time is
5 - 10 mins longer than the last time stamp then take 1% hunger.
otherwise do nothing...
I might be barking up the wrong tree, any advice guys?
I apreciate it.
Posted 01 September 2006 - 10:33 PM
Posted 01 September 2006 - 10:44 PM
time() + 10; or what ever? :/
To check every 10 minutes to last time updated.
Posted 01 September 2006 - 11:08 PM
Myabe this will point you in the right direction:
If you're storing the time in a database, you will need to use conditional statements and define the actions taken depending on the difference in time. You should store them as timestamps and then format them before doing the comparisons.
Take a look at :
Posted 01 September 2006 - 11:23 PM
Just something i'm doing for fun...
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users