Announcement

Collapse
No announcement yet.

tune.php help

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • tune.php help

    im trying to get this v2 code to wrok can anyone help thanks
    here is the code
    Code:
    <?php
    include "globals.php";
    print "<h3>Tuning Shop</h3><hr />
    > Back To Garage<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";
    }
    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</td></tr>
    <tr><td>Speed</td> <td>Lv{$r['cpcSPDLV']} ($spd)</td> <td>{$costf['spd']}</td> <td>Tune</td></tr>
     <tr> <td>Handling</td> <td>Lv{$r['cpcHANLV']} ($han)</td> <td>{$costf['han']}</td> <td>Tune</td></tr>
     <tr> <td>Shield</td> <td>Lv{$r['cpcSHDLV']} ($shd)</td>  <td>{$costf['shd']}</td> <td>Tune</td></tr>
    </table>";
    }
    $h->endpage();
    ?>
    and here is the error i get
    Code:
    Fatal error: Call to undefined function power() in /home/avfc1993/public_html/tune.php on line 9

  • #2
    Re: tune.php help

    Legit version?

    Comment


    • #3
      Re: tune.php help

      Then the code is trying to call a function [ power() ] but is unable to find it.
      [tabmenu][tab='About Me'] Hello,
      My name is scott. I have been a member of "Make Web Games"/"PHP=Games"/"Criminal-Existence for over 3 years. In this time i have left for a few periods of time, my longest being January 2009 until i returned February 2010. When i signed up to this site it was originally called Criminal-Existence so if you hear me refer to this site as CE that will be the reason. When i first joined, i knew nothing, zilch, nada about coding.
      [progressbar=93,#00cc00]Xvon[/progressbar][tab='My Mods (5)'] Version 1
      Updated Help Tutorial
      Updated friends and black lists
      Version 2
      Updated mailbox
      Updated friends and black lists
      Updated preferences[/tabmenu]

      Comment


      • #4
        Re: tune.php help

        i still get an error on line 9

        Comment


        • #5
          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
          Need a mod for your game? I do work that is second to none. PM me for further details or click on my banner to view my website.

          Comment

          Working...
          X