Jump to content

Sql update after some time


callesson

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.