Our Scripts Vault contains many game scripts that you can use to create your own game!
<?phpinclude_once 'connect.php'; session_start(); include_once 'logo.php';?> <?phpif (isset($_SESSION['player'])){ $player=$_SESSION['player'];} else{ echo "Not Logged in <br><br> <A href='login.php'>Login</a>"; exit;}?></div><?php $playerinfo="SELECT * from players where name='$player'";$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");$playerinfo3=mysql_fetch_array($playerinfo2);$pid = $playerinfo3['id']; ?> <?php$firstmod = (int)($playerinfo3['exper'] * .07); $totalexper =$playerinfo3['exper'] - $firstmod; $totalexper = $totalexper; echo "<br><b><big>You died, you lost " . $firstmod . " experience.</b></big><br>"; $updateplayer="update players set exper='$totalexper' where name = '$player'"; mysql_query($updateplayer) or die("Could not update player"); echo "<br><br><a href='index.php'>Go back to town"; $updateplayer="update players set hpoints='1' where name='$player'"; mysql_query($updateplayer) or die("Could not update player"); ?>
so when my players die they go to gameover.php, should i post this line in the gameover.php script?
Chris why not store as some of the column type that is designed to hold time data (datetime)?