gedizz Posted May 12, 2017 Share Posted May 12, 2017 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? Quote Link to comment Share on other sites More sharing options...
requinix Posted May 12, 2017 Share Posted May 12, 2017 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. Quote Link to comment Share on other sites More sharing options...
ginerjm Posted May 13, 2017 Share Posted May 13, 2017 Or create a JS function in the page so that when you send the page with the 'in stance' appears, a timer in that jS function kicks off and cause the page to change as you want it to. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.