Jump to content

quick help.


seany123

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/130973-quick-help/page/2/#findComment-686314
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.