Aderik Posted January 16, 2011 Posted January 16, 2011 Recently it's come to my attention that players are able to "attack someone until they have 0 health, go do some mining and then come back to pummel them before the tick gives them health" I'm going on the assumption that this isn't supposed to happen since it has set that players lose exp when they leave a fight to go to another page. Is there a fix to prevent players from leaving then re-entering a fight? Quote
rulerofzu Posted January 17, 2011 Posted January 17, 2011 Check if they have 0 health before anything else. if($ir['hp'] == 0) { // give them a message or just end the page } Quote
Aderik Posted January 18, 2011 Author Posted January 18, 2011 Sorry, shouldn't of put such an exact quote XD The problem is that they (player a) are attacking player b, dropping the player b's health to 0 health, 'leave' the fight with health (player a), then player a can come back and defeat player b while player b still has 0 health. Considering the experience drop they recieve when they 'leave' I don't think this should happen. Quote
Diesl Posted January 21, 2011 Posted January 21, 2011 You could add some sort of restriction that a player can not be attacked unless they have at least 33%, 50%, etc, health. Something such as: if($playerb['health'] < ($playerb['maxhealth']*0.5)) //0.5 for 50% health { die("message"); } Quote
Aderik Posted January 24, 2011 Author Posted January 24, 2011 if($_GET['nextstep'] && $odata['hp'] <= 33) { if($ir['attacking'] == 0) { print "<center>The enemy is too wary to attack. Try again at a more opportune time. [[url='index.php'] Go Back [/url]]"; $h->endpage(); exit; } } What I currently have for the health. *** Fixed, thank you again Equinox Quote
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.