tittlemouse Posted March 11, 2008 Posted March 11, 2008 im trying to get this v2 code to wrok can anyone help thanks here is the code <?php include "globals.php"; print "<h3>Tuning Shop</h3><hr /> > [url='garage.php']Back To Garage[/url]<hr />"; if(!$_GET['id']) { die("Invalid Usage"); } $q=mysql_query("SELECT cp.*,ct.* FROM cars_playercars cp LEFT JOIN cars_types ct ON ct.carID=cp.cpcCAR WHERE cp.cpcID={$_GET['id']} AND cp.cpcPLAYER=$userid", $c); if(mysql_num_rows($q) == 0) { die("Invalid Car"); } $r=mysql_fetch_array($q); $cost['acc']=$r['carACC']*power($r['cpcACCLV']+1,4)*($r['cpcACCLV']*$r['carACC']*10); $cost['han']=$r['carHAN']*power($r['cpcHANLV']+1,4)*($r['cpcHANLV']*$r['carHAN']*10); $cost['spd']=$r['carSPD']*power($r['cpcSPDLV']+1,4)*($r['cpcSPDLV']*$r['carSPD']*10); $cost['shd']=$r['carSHD']*power($r['cpcSHDLV']+1,4)*($r['cpcSHDLV']*$r['carSHD']*10); if($_GET['buy']) { if($_GET['buy'] != "acc" && $_GET['buy'] != "han" && $_GET['buy'] != "spd" && $_GET['buy'] != "shd") { die("Abusers suck."); } $upgr_cost=$cost[$_GET['buy']]; if($ir['money'] < $upgr_cost) { die("You don't have enough money to tune this stat."); } mysql_query("UPDATE users SET money=money-{$upgr_cost} WHERE userid=$userid", $c); $stat="cpc".strtoupper($_GET['buy'])."LV"; mysql_query("UPDATE cars_playercars SET $stat=$stat+1 WHERE cpcID={$_GET['id']}", $c); print "Car tuned! > [url='tune.php?id={$_GET[']Tune some more[/url]"; } else { foreach($cost as $k => $v) { $costf[$k]='$'.number_format($v); } $acc=$r['cpcACCLV']*$r['carACC']; $han=$r['cpcHANLV']*$r['carHAN']; $spd=$r['cpcSPDLV']*$r['carSPD']; $shd=$r['cpcSHDLV']*$r['carSHD']; print "Current Stats for your {$r['carNAME']} <table width='90%'><tr> <th>Stat</th> <th>Amount</th> <th>Cost To Tune</th> <th>Tune</th></tr> <tr> <td>Acceleration</td> <td>Lv{$r['cpcACCLV']} ($acc)</td> <td>{$costf['acc']}</td> <td>[url='tune.php?id={$_GET[']Tune[/url]</td></tr> <tr><td>Speed</td> <td>Lv{$r['cpcSPDLV']} ($spd)</td> <td>{$costf['spd']}</td> <td>[url='tune.php?id={$_GET[']Tune[/url]</td></tr> <tr> <td>Handling</td> <td>Lv{$r['cpcHANLV']} ($han)</td> <td>{$costf['han']}</td> <td>[url='tune.php?id={$_GET[']Tune[/url]</td></tr> <tr> <td>Shield</td> <td>Lv{$r['cpcSHDLV']} ($shd)</td> <td>{$costf['shd']}</td> <td>[url='tune.php?id={$_GET[']Tune[/url]</td></tr> </table>"; } $h->endpage(); ?> and here is the error i get Fatal error: Call to undefined function power() in /home/avfc1993/public_html/tune.php on line 9 Quote
03laceys Posted March 11, 2008 Posted March 11, 2008 Re: tune.php help Then the code is trying to call a function [ power() ] but is unable to find it. Quote
tittlemouse Posted March 11, 2008 Author Posted March 11, 2008 Re: tune.php help i still get an error on line 9 Quote
Floydian Posted March 12, 2008 Posted March 12, 2008 Re: tune.php help you gotta define the function power obviously, it isn't a function that is predefined in PHP where did you get the mod? is it a paid mod, free mod, make it yourself? we'll need to know what it's supposed to do to help. or you could contact the person that wrote it 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.