Godhand Posted October 2, 2007 Share Posted October 2, 2007 I have installed a function that defines if hp is under a certain value that it cancels an attack. (the knocked out code) But my question is how would this be coded properly? $_GET['nextstep']=1 some statement here if($odata['hp'] <= ($odata['maxhp'])/3) { print "Wait till their hp is above one third of their max to bother to attack them [url='index.php']> Back[/url]"; What would that statement be so it could include this? Quote Link to comment Share on other sites More sharing options...
UCC Posted October 2, 2007 Share Posted October 2, 2007 Re: (v2 attack.php question) I use this, not sure if it is plug and play into stock code or not. My attack file is highly modified. It looks pretty basic so it should work. if(($odata['hp'] < ($odata['maxhp'] / 2)) && $_SESSION['attacking'] == 0) { print "You cannot attack a player until they have 1/2 their max health. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } Quote Link to comment Share on other sites More sharing options...
Godhand Posted October 2, 2007 Author Share Posted October 2, 2007 Re: (v2 attack.php question) Thank you there was just one snag I fixed it though its if(($odata['hp'] < ($odata['maxhp'] / 2)) && $_SESSION['attacking'] == 0) { print "You cannot attack a player until they have 1/2 their max health. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; I figured since you posted its probably a free mod but that will patch up the error message I got since } was already taken care of. Also it is what I wanted coded I just thought it would be a little different. 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.