Joshua Posted June 27, 2009 Posted June 27, 2009 So after testing my game out I'm noticing that the charachters Ages, the Mystery box and a few other things aren't updating like they should...Anyone see an error here? <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $db->query("UPDATE fedjail set fed_days=fed_days-1"); $q=$db->query("SELECT * FROM fedjail WHERE fed_days=0"); $ids=array(); while($r=$db->fetch_row($q)) { $ids[]=$r['fed_userid']; } if(count($ids) > 0) { $db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")"); } $db->query("UPDATE users SET userCONTRACT = userCONTRACT - 1 WHERE userCONTRACT > 0"); $db->query("UPDATE users SET userBANKAMMT = userBANKAMMT + (userBANKAMMT/100*5.5) WHERE userBANKAMMT > 0 AND investlevel = 1"); $db->query("UPDATE users SET userBANKAMMT = userBANKAMMT + (userBANKAMMT/100*3.0) WHERE userBANKAMMT > 0 AND investlevel = 0"); $db->query("UPDATE users SET userBANKAMMT = userBANKAMMT + (userBANKAMMT/100*7.2) WHERE userBANKAMMT > 0 AND investlevel = 2"); $db->query("UPDATE users SET userDAYS = userDAYS - 1 WHERE userDAYS != 0"); $db->query("UPDATE users SET happiness=happiness-1 WHERE married != 0"); $db->query("DELETE FROM fedjail WHERE fed_days=0"); $db->query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0"); $db->query("UPDATE users SET daysold=daysold+1, boxes_opened = 0"); $db->query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0"); $db->query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0"); $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney>0"); $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney>0 and donatordays>0"); $db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney/100*7) where cybermoney>0"); $db->query("TRUNCATE TABLE votes;"); $houses = mysql_query(sprintf("SELECT * FROM `owned_houses` LEFT JOIN `users` ON (`userid` = `uhouseTenant`) WHERE `uhouseTenant` > '0'")); while ($r = mysql_fetch_array($houses)) { mysql_query("UPDATE `owned_houses` SET `uhouseRTime` = `uhouseRTime` - '1' WHERE `uhouseRTime` > '0'"); mysql_query(sprintf("UPDATE `users` SET `money` = `money` - '%d' WHERE `userid` = '%u'", $r['uhouseRent'], $r['uhouseTenant'])); mysql_query(sprintf("UPDATE `users` SET `money` = `money` + '%d' WHERE `userid` = '%u'", $r['uhouseRent'], $r['uhouseOwner'])); mysql_query("UPDATE `owned_houses` SET `uhouseTenant` = '0' WHERE `uhouseRTime` <= '0'"); } ?> Then to top it off, in my error log, i'm getting this for my Captcha PHP Fatal error: Call to undefined function imagecreatetruecolor() in /home/thug/public_html/captcha_verify.php on line 26 <?php function parse_bgcolor() { if(strlen($_GET['bgcolor']) == 6) { $p1=$_GET['bgcolor'][0].$_GET['bgcolor'][1]; $p2=$_GET['bgcolor'][2].$_GET['bgcolor'][3]; $p3=$_GET['bgcolor'][4].$_GET['bgcolor'][5]; } else { $p1=$_GET['bgcolor'][0].$_GET['bgcolor'][0]; $p2=$_GET['bgcolor'][1].$_GET['bgcolor'][1]; } return array(hexdec($p1),hexdec($p2),hexdec($p3)); } session_start(); $bgcolor=($_GET['bgcolor']) ? parse_bgcolor() : array(255,255,255); $text=array(255-$bgcolor[0],255-$bgcolor[1],255-$bgcolor[2]); $distort=rand(80,120)/100; $distort2=rand(80,120)/100; $f_x=round(75*$distort); $f_y=round(25*$distort); $s_x=round(175*$distort2); $s_y=round(70*$distort2); $first=imagecreatetruecolor($f_x, $f_y); $second=imagecreatetruecolor($s_x, $s_y); $white=imagecolorallocate($first, $bgcolor[0], $bgcolor[1], $bgcolor[2]); $black=imagecolorallocate($first, 0, 0, 0); $red=imagecolorallocate($first, 255, 0, 0); $green=imagecolorallocate($first, 0, 128, 0); $blue=imagecolorallocate($first, 0, 0, 255); imagefill($first, 0, 0, $white); $color[0]=$red; $color[1]=$green; $color[2]=$blue; for($i=0; $i<=2; $i++) { $points = array( 0 => array(10, $f_x - 10), 1 => array(5, $f_y - 5), 2 => array(10, $f_x - 10), 3 => array(5, $f_y - 5), 4 => array(10, $f_x - 10), 5 => array(5, $f_y - 5), 6 => array(10, $f_x - 10), 7 => array(5, $f_y - 5), 8 => array(10, $f_x - 10), 9 => array(5, $f_y - 5), ); imagefilledpolygon($first, $points, 5, $red); } imagestring($first, 4, rand(0, $f_x/3), rand(0,$f_y/2.5), $_SESSION['captcha'], $black); imagecopyresized($second, $first, 0, 0, 0, 0, $s_x, $s_y, $f_x, $f_y); imagedestroy($first); $red=imagecolorallocate($second, 255, 0, 0); $green=imagecolorallocate($second, 0, 128, 0); $blue=imagecolorallocate($second, 0, 0, 255); $RandomPixels=ceil($s_x*$s_y/100); for($i=0;$i<$RandomPixels;$i++) { $locx=rand(0,$s_x-1); $locy=rand(0,$s_y-1); imagesetpixel($second, $locx, $locy, $red); } for($i=0;$i<$RandomPixels;$i++) { $locx=rand(0,$s_x-1); $locy=rand(0,$s_y-1); imagesetpixel($second, $locx, $locy, $green); } for($i=0;$i<$RandomPixels;$i++) { $locx=rand(0,$s_x-1); $locy=rand(0,$s_y-1); imagesetpixel($second, $locx, $locy, $blue); } $randcolor=imagecolorallocate($second, rand(100,255), rand(100,255), rand(100,255)); for($i=0; $i<5; $i++) { imageline($second, rand(0, $s_x), rand(0, $s_y), rand(0, $s_x), rand(0, $s_y), $randcolor); $randcolor=imagecolorallocate($second, rand(100,255), rand(100,255), rand(100,255)); } @header("Content-Type: image/png"); $finished=imagerotate($second, rand(0,15)-7.5, $bgcolor[2]*65536+$bgcolor[1]*256+$bgcolor[0]); imagedestroy($second); imagepng($finished); imagedestroy($finished); ?> There should be no reason this isn't working..i just get a Red X when i turn my cap on :\ Any help for +5? Quote
Joshua Posted June 27, 2009 Author Posted June 27, 2009 Re: Help Please, Day cron and Captcha Beleive I fixed the error in my cron as it appears to be working now. Quote
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.