lucky3809 Posted September 24, 2010 Share Posted September 24, 2010 Need some help, cant figure out what code to change im using the original v2 attack.php the problem is where it says " You done this much damage 90000 (-90000)." The minus 90000 being the opponents health, how would I change that to just come out (0) instead of the negative 90000? I know this is stupid asking, I would probably find it out sooner or later, just cant seem to see where the minus is coming from or where i change it lol. Edit: 90000 is just an example used... Quote Link to comment Share on other sites More sharing options...
Equinox Posted September 24, 2010 Share Posted September 24, 2010 Use the abs() function, it returns the absolute value of a number. echo 'You attacked '.$Username.' and done '.$Damage.' ('.abs($HealthLeft).''; That is an example. Quote Link to comment Share on other sites More sharing options...
lucky3809 Posted September 24, 2010 Author Share Posted September 24, 2010 Thank you, i thought of doing that just didnt do it yet, I was a bit tired when I was figuring it out, I had looked through the whole page for over an hour trying to figure what would return the absolute value and couldnt come up with anything lol. Then while I went to sleep and had my computer off I thought about it lol. Thanks for replying and confirming what I was thinking :-) 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.