Jump to content

[SOLVED] minus!!


grlayouts

Recommended Posts

$mypower = ($mywep[power] + $stat[strength] - $earm[power]);
if($mypower<0){ ($mypower=0);
$epower = ($enemy[strength] + $ewep[power] - $myarm[power] );
if($epower<0){ ($epower=0);

 

this still aint working, when i run the script i get

Fatal error: Unknown function: attackback() in /home/hobotown/public_html/battle.php on line 566

Link to comment
https://forums.phpfreaks.com/topic/38170-solved-minus/#findComment-182865
Share on other sites

You're still not posting the relevant code, that's why I agreed. You posted SQL statements, and what you wrote will work in SQL. Your code has nothing about the function (attackback()) that the error is referencing.

 

You said you tried the suggestion Toon posted, yet when I asked you to post it you said you had, but the code doesn't have his suggestion.

 

This code is missing brackets:

 

$mypower = ($mywep[power] + $stat[strength] - $earm[power]);

if($mypower<0){

  $mypower=0;

}

$epower = ($enemy[strength] + $ewep[power] - $myarm[power] );

if($epower<0){

  $epower=0;

}

 

Link to comment
https://forums.phpfreaks.com/topic/38170-solved-minus/#findComment-182868
Share on other sites

How are you so sure? You can't figure out how to do an if statement, but you're sure the rest of the code works? I'm not saying post all the code, but the ERROR is very specific about the function and the line, and what you posted has nothing to do with it.

 

What you posted was incorrect code however, and if you fix the brackets that may fix it.

Link to comment
https://forums.phpfreaks.com/topic/38170-solved-minus/#findComment-182872
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.