PDA

View Full Version : tune.php help



tittlemouse
03-11-2008, 09:51 PM
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 />
> Back To Garage ('garage.php')<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!

> Tune some more ('tune.php?id={$_GET[')";
}
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>Tune ('tune.php?id={$_GET[')</td></tr>
<tr><td>Speed</td> <td>Lv{$r['cpcSPDLV']} ($spd)</td> <td>{$costf['spd']}</td> <td>Tune ('tune.php?id={$_GET[')</td></tr>
<tr> <td>Handling</td> <td>Lv{$r['cpcHANLV']} ($han)</td> <td>{$costf['han']}</td> <td>Tune ('tune.php?id={$_GET[')</td></tr>
<tr> <td>Shield</td> <td>Lv{$r['cpcSHDLV']} ($shd)</td> <td>{$costf['shd']}</td> <td>Tune ('tune.php?id={$_GET[')</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

Anonymous
03-11-2008, 09:58 PM
Legit version?

03laceys
03-11-2008, 10:19 PM
Then the code is trying to call a function [ power() ] but is unable to find it.

tittlemouse
03-11-2008, 10:30 PM
i still get an error on line 9

Floydian
03-12-2008, 11:35 PM
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