callesson Posted April 16, 2010 Share Posted April 16, 2010 Hello Guys. I'm having this php game im making and i need some help with time period. What i would like to do is: If you have low Health you need to go to hospital, once your inside the hospital you will get like 10 % of your health every 1 min. Also your not gonna be able to do anything else once your out from the hospital. And I dont know how to work with time like this... Ty! Link to comment https://forums.phpfreaks.com/topic/198728-sql-update-after-some-time/ Share on other sites More sharing options...
shorty3 Posted April 16, 2010 Share Posted April 16, 2010 is your game online so i can see Link to comment https://forums.phpfreaks.com/topic/198728-sql-update-after-some-time/#findComment-1042935 Share on other sites More sharing options...
deanlearner Posted April 16, 2010 Share Posted April 16, 2010 Sorry, no help but, is the game purely PHP based, like via the CLI? Or is it presented via a web interface or something? Link to comment https://forums.phpfreaks.com/topic/198728-sql-update-after-some-time/#findComment-1042937 Share on other sites More sharing options...
callesson Posted April 16, 2010 Author Share Posted April 16, 2010 Sry if it took me long but i was away, #shorty3: No, sry its not online. #deanlearner: Its pure php. Link to comment https://forums.phpfreaks.com/topic/198728-sql-update-after-some-time/#findComment-1042998 Share on other sites More sharing options...
deanlearner Posted April 16, 2010 Share Posted April 16, 2010 Maybe you could check the time between the last player action and the current action and calculate based on that? Like... 15:50pm - enter hospital 15:55pm - did something else (and run function add_health($player_id,$last_action_time,$next_action_time) ) the add_health() function could then work out the duration between the two times and add health as required. Link to comment https://forums.phpfreaks.com/topic/198728-sql-update-after-some-time/#findComment-1043024 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.