Grid Map System - Stamina Usage
Posted: Thu Nov 04, 2010 11:43 pm
Thought I'd post up what I coded so far in regard to the stamina system for use with the map grid. Just do a search & insert.
Edited the following to include the $_GET stamina.
Then applied the relevant code changes to the map, so once the player's stamina reaches 0, then you are unable to move.
You could add the following beside your stamina bar indicator to warn the player.
Now I just need to prevent the player from fast-traveling, then it will be sorted.
If anybody else has any further suggestions, feel free to add your input! 
Edited the following to include the $_GET stamina.
Code: Select all
<?php
$stamina=$_GET['stamina'];
if ($playerinfo3['mapr']!=$row||$playerinfo3['mapc']!=$column)
{
$updatenewloc="Update players set mapr=$row,mapc=$column,stamina=$stamina where name='$player'";
mysql_query($updatenewloc) or die("Could not update new location");
$playerinfo3['mapr'] = $row;
$playerinfo3['mapc'] = $column;
$pllevel = $playerinfo3['level'];
$playerinfo3['stamina'] = $stamina;
}
?>Code: Select all
<div id="grid1"><a href="<?php if ($playerinfo3['stamina'] == '0'){ /* DO NOTHING */ } elseif ($nwestinfo3['tile'] == "boundry"){echo "map.php";}else {echo "../locations/map.php?row=$rowminus1&column=$columnminus1&stamina=$staminaminus1";} ?>"><img src="../images/<?php echo $nwestinfo3['tile']; ?>.png"width="130" height="130" border="0" title="Travel North-West"/></a></div></td>
Code: Select all
<?php if ($playerinfo3['stamina'] == '0') {echo "<font style='text-decoration:blink'>!!</font>";} ?>