Jump to content
MakeWebGames

Recommended Posts

Posted

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?

Posted

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;

}
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...