Jump to content

PHP timer for game


gedizz

Recommended Posts

I am a developer for a mount and blade warband persistent world server and I am trying to create anti-combat log scripts. In the game when a player is damaged what i'd like to do is send a message to a php file that would capture their user id's and such. So essentially what would happen is it would get their id, then echo back to the game that they are now in a 'combat stance'. Once that part echoes it will tell them that and after 60 seconds it's supposed to tell them that they are not in combat stance anymore. 

 

What i'm wondering is how I could run this timer through php so after 60 seconds it echoes again that they are not in the combat stance. So im wondering how to run the first half of the file and then after 60 seconds run the second half. If that's not possible it would also work to send another query to a seperate file that does not run at all for 60 seconds.

 

I've been struggling with this for a while now... any suggestions?

Link to comment
Share on other sites

A timer is generally not the best approach when it comes to PHP.

 

Instead, track the time they entered combat and then later, when you need to know, you determine whether they're in combat according to that time.

Link to comment
Share on other sites

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.