KDawg08 Posted April 16, 2008 Share Posted April 16, 2008 else if ($youdata['hp'] >= $youdata['maxhp']/2) { $youdata['hp']-= $youdata['maxhp']/2; $me=$youdata['maxhp']/2; $_SESSION['attacklog']=""; } else { print "<font color='red'>[b]You need 50% health or more.</font>[/b]"; $h->endpage(); exit; } I'm trying to force it to NOT let a user attack if they don't have 50% or more health... The codes already have an IF USER BEING ATTACKED HAS 50% or less u can't attack but not the other way around. Any suggestions or see where i went wrong? Quote Link to comment Share on other sites More sharing options...
KDawg08 Posted April 16, 2008 Author Share Posted April 16, 2008 Re: NEED 50% health for attack... Help? NEVERMIND EVERYONE... I found my mistakes... This worked instead. else if ($ir['hp'] >= $ir['maxhp']/2) { $ir['hp']-= $ir['maxhp']/2; $me=$ir['maxhp']/2; $_SESSION['attacklog']=""; } else { print "<font color='red'>[b]You need atleast 50% health to attack.</font>[/b]"; $h->endpage(); $_SESSION['attacking']=0; exit; } 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.