seany123 Posted November 9, 2008 Author Share Posted November 9, 2008 Right this is my current Cron file: <?php if(!defined('IN_GAME')) die('HACK'); $query = "SELECT * FROM players"; $result = mysql_query($query) OR die(mysql_error()); while ($row = mysql_fetch_assoc($result)) { $energy = $row['energy'] + ($row['maxenergy'] * .20); $energy = ($energy > $row['maxenergy']) ? $row['maxenergy'] : $energy; $query = sprintf('UPDATE players SET energy = %d WHERE id = %d', $energy, $row['id']); mysql_query($query) or die(mysql_error()); } $query = "SELECT * FROM players"; $result = mysql_query($query) OR die(mysql_error()); while ($row = mysql_fetch_assoc($result)) { $nerve = $row['nerve'] + ($row['maxnerve'] * .20); $nerve = ($nerve > $row['maxnerve']) ? $row['maxnerve'] : $nerve; $query = sprintf('UPDATE players SET nerve = %d WHERE id = %d', $nerve, $row['id']); mysql_query($query) or die(mysql_error()); } $query = "SELECT * FROM players"; $result = mysql_query($query) OR die(mysql_error()); while ($row = mysql_fetch_assoc($result)) { $hp = $row['hp'] + ($row['maxhp'] * .25); $hp = ($hp > $row['maxhp']) ? $row['maxhp'] : $hp; $query = sprintf('UPDATE players SET hp = %d WHERE id = %d', $hp, $row['id']); mysql_query($query) or die(mysql_error()); } $awakeupdate = $player->awake + 5; $query = $db->execute("update `players` set `awake`=? where `id`=? and `awake`<`maxawake`", array($awakeupdate, $player->id)); ?> awake doesnt go up so if anyone can help it would be appreciated 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.