Join the forums now, and start posting to receive access to our Scripts Vault!
$ButtonShowed="False"; while (!isset($_POST['Continue']) and $ButtonShowed!="True" and $player['curhp'] > 0 and $monster['curhp'] > 0) { ?><form name=ContinueFighting action="<?php echo $_SERVER['PHP_SELF']?>" method=Post> <input type=button class=button name=Continue value="Attack Again"> </form><? $ButtonShowed="True";}
if($turns > 30) { //If the number of turns exceeds 30, stop combat die ("Stale mate! You did not kill the monster, and it did not kill you within the 30 turn combat limit.<br><a href=main.php>Return to Main Map</a>");}
<?php$ButtonShowed = false ;while ((( ! isset( $_POST['Continue'] ) && ! $ButtonShowed ) && ( $player['curhp'] > 0 ) ) && ($monster['curhp'] > 0) ) { ?> <form name=ContinueFighting action="<?php echo $_SERVER['PHP_SELF'] ; ?>" method=Post> <input type=button class=button name=Continue value="Attack Again"> </form> <?php $ButtonShowed = true ; }?>
The problem with this being that combat shows all the buttons at the top of the screen, but continues to run despite. I'm pretty sure that it's due to the $ButtonShowed being made True and thus cancelling the loop.
But if I leave it out, it merely goes into an infinite loop, not allowing the user to click the button, or for combat to continue.