Dominion Posted May 18, 2013 Share Posted May 18, 2013 I'd also make it so they'd have to buy it, but the client gets what the client wants ;) "You must spread some Reputation around before giving it to Magictallguy again" I like seeing posts like this. Not sure what else to say so... thanks for helping out a member. :) Quote Link to comment Share on other sites More sharing options...
Djkanna Posted May 18, 2013 Share Posted May 18, 2013 "You must spread some Reputation around before giving it to Magictallguy again" I like seeing posts like this. Not sure what else to say so... thanks for helping out a member. :) I second this ( also must spread rep around ). It's good to see this kind of thing again, it's been a while. Quote Link to comment Share on other sites More sharing options...
Script47 Posted May 18, 2013 Share Posted May 18, 2013 I second this ( also must spread rep around ). It's good to see this kind of thing again, it's been a while. The forums are hopefully on the way up again hopefully, keep it up Magic + rep :) Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted May 18, 2013 Share Posted May 18, 2013 (edited) cardealer.php <?php include(__DIR__ . '/globals.php'); echo "<!-- Created by Magictallguy -->"; $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : null; $_GET['ID'] = isset($_GET['ID']) && ctype_digit($_GET['ID']) ? abs(@intval($_GET['ID'])) : null; switch($_GET['action']) { case 'buy': buyCar(); break; default: carIndex(); break; } function error($msg) { global $h; echo "<div style='color: #D8000C;background-color: #FFBABA;border: 1px solid;background-repeat: no-repeat;background-position: 10px center;width: 40%;border-radius: 15px;margin: 10px 0;padding: 15px 10px 15px 50px;'><strong>ERROR!</strong><br />",$msg,"<br /><a onclick='window.history.go(-1);' style='cursor:pointer;'>Back</a> · <a href='index' style='color:black;'>Home</a></div>"; $h->endpage(); exit; } function success($msg) { echo "<div style='color: #4F8A10;background-color: #DFF2BF;border: 1px solid;background-repeat: no-repeat;background-position: 10px center;width: 40%;border-radius: 15px;margin: 10px 0;padding: 15px 10px 15px 50px;'><strong>Success!</strong><br />",$msg,"<br /><a onclick='window.history.go(-1);' style='cursor:pointer;'>Back</a> · <a href='index' style='color:black;'>Home</a></div>"; } function format($str, $dec = 0) { return ctype_digit($str) ? number_format($str, $dec) : stripslashes(htmlspecialchars($str)); } function carIndex() { global $db, $ir; echo "<h3>Cars: Car Dealership</h3>"; $selectGarage = $db->query(sprintf("SELECT `pgID` FROM `playerGarages` WHERE (`pgUser` = %u)", $ir['userid'])); if(!$db->num_rows($selectGarage)) { echo "<a href='garage.php'>Buy your own driveway</a>"; } ?><table class='table' width='100%' cellspacing='1'> <tr> <th width='25%'>Car/Description</th> <th width='20%'>Cost</th> <th width='50%'>Stats</th> <th width='5%'>Links</th> </tr><? $select = $db->query("SELECT * FROM `cars` ORDER BY `cCost` ASC, `cName` ASC"); if(!$db->num_rows($select)) { echo "<tr><td colspan='3' class='center'>There are no available cars</td></tr>"; } else { while($row = $db->fetch_row($select)) { ?><tr> <td><strong><? echo format($row['cName']); ?></strong><? echo nl2br(format($row['cDesc'])); ?></td> <td>$<? echo format($row['cCost']); ?></td> <td><table class='table' width='100%' cellspacing='1'> <tr> <th width='10%'>Speed</th> <td width='40%'><? echo format($row['cSpeed']); ?></td> <th width='10%'>Handling</th> <td width='40%'><? echo format($row['cHandling']); ?></td> </tr> <tr> <th width='10%'>Acceleration</th> <td width='40%'><? echo format($row['cAccel']); ?></td> <th width='10%'>Braking</th> <td width='40%'><? echo format($row['cBrake']); ?></td> </tr> </table></td> <td><? echo ($ir['money'] >= $row['cCost']) ? "<a href='cardealer.php?action=buy&ID=".$row['cID']."'>Buy</a>" : "<span style='color:#444;'><em>Buy</em></span>"; ?></td> </tr><? } } echo "</table>"; } function buyCar() { global $db, $ir; echo "<h3>Cars: Car Dealership: Buying a car</h3>"; if(empty($_GET['ID'])) { error("You didn't select a valid car"); } $selectCar = $db->query(sprintf("SELECT * FROM `cars` WHERE (`cID` = %u)", $_GET['ID'])); if(!$db->num_rows($selectCar)) { error("That car doesn't exist"); } $row = $db->fetch_row($selectCar); $selectGarage = $db->query(sprintf("SELECT `pgCapacity`, `pgType` FROM `playerGarages` WHERE (`pgUser` = %u)", $ir['userid'])); if(!$db->num_rows($selectGarage)) { error("You don't have anywhere to park your car. You must buy a driveway before you can buy a car"); } $garage = $db->fetch_row($selectGarage); $selectPlayerCars = $db->query(sprintf("SELECT COUNT(`pcID`) FROM `playerCars` WHERE (`pcUser` = %u)", $ir['userid'])); $getGarageName = $db->query(sprintf("SELECT `gTypeName` FROM `garageTypes` WHERE (`gTypeID` = %u)", $garage['pgType'])); $garageName = $db->fetch_single($getGarageName); if($db->fetch_single($selectPlayerCars) >= $garage['pgCapacity']) { error("Your ".format($garageName)." is full. You must upgrade it before you can fit any more cars"); } if($ir['money'] < $row['cCost']) { error("You don't have enough money to buy the ".format($row['cName'])); } $db->query(sprintf("INSERT INTO `playerCars` VALUES ('', %u, %u, %u, %u, %u, %u)", $ir['userid'], $_GET['ID'], $row['cSpeed'], $row['cHandling'], $row['cAccel'], $row['cBrake'])); success("You've bought the ".format($row['cName'])); } $h->endpage(); ?> Bloody hell your quick - I've always said it but this is ridiculous! xD I'm slowing down due to family getting in the way lol Edited May 19, 2013 by Magictallguy Added quote, bug fixes Quote Link to comment Share on other sites More sharing options...
Script47 Posted May 18, 2013 Share Posted May 18, 2013 I'm slowing down due to family getting in the way lol ^^^^ Calls this slow! xD Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted May 18, 2013 Share Posted May 18, 2013 ^^^^ Calls this slow! xD Indeed, considering the family are now demanding time with me preventing me from doing what I want to .. again xD I'll finish up tomorrow. Coming soon: Garage Types (staff side) Upgrade Garage Upgrade Car Sell Car RacesFun Bet Pinks 1 Quote Link to comment Share on other sites More sharing options...
peterisgb Posted May 18, 2013 Share Posted May 18, 2013 Car images would be a good idea aswell. be really handy. Quote Link to comment Share on other sites More sharing options...
SRB Posted May 18, 2013 Share Posted May 18, 2013 "You must spread some Reputation around before giving it to Magictallguy again" I like seeing posts like this. Not sure what else to say so... thanks for helping out a member. :) I second this ( also must spread rep around ). It's good to see this kind of thing again, it's been a while. Rep given with comment On Behalf of DJK and Dom 1 Quote Link to comment Share on other sites More sharing options...
Djkanna Posted May 18, 2013 Share Posted May 18, 2013 You must spread some Reputation around before giving it to Guest again. Bollocks. -2short- Quote Link to comment Share on other sites More sharing options...
Dominion Posted May 18, 2013 Share Posted May 18, 2013 Rep given with comment On Behalf of DJK and Dom Thank you. Quote Link to comment Share on other sites More sharing options...
SRB Posted May 18, 2013 Share Posted May 18, 2013 "You must spread some Reputation around before giving it to Magictallguy again" I like seeing posts like this. Not sure what else to say so... thanks for helping out a member. :) I second this ( also must spread rep around ). It's good to see this kind of thing again, it's been a while. Anybody know the way that works? How many before you can hit someone else with one again? Bollocks. -2short- Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted May 19, 2013 Share Posted May 19, 2013 Anybody know the way that works? How many before you can hit someone else with one again? 5 reps given elsewhere, or receive a rep from the "repped" 1 Quote Link to comment Share on other sites More sharing options...
Razor42 Posted May 19, 2013 Author Share Posted May 19, 2013 Thanks for the work so far MTG! Ill test it all out tomorrow when ill have free time. Will deffinatly offer you some finances for this when its done for doing such a great job :). Quote Link to comment Share on other sites More sharing options...
Scorpio Posted May 19, 2013 Share Posted May 19, 2013 If I was a rich man MTG, I would be giving you money! But then Im 13 and poor. Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted May 19, 2013 Share Posted May 19, 2013 If I was a rich man MTG, I would be giving you money! But then Im 13 and poor. Indeed, such is the life of a child! xD Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted May 19, 2013 Share Posted May 19, 2013 (edited) garage.php <?php include(__DIR__ . '/globals.php'); echo "<!-- Created by Magictallguy -->"; $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : null; switch($_GET['action']) { case 'buy': buyGarage(); break; case 'upgradegarage': upgradeGarage(); break; case 'upgrade': upgradeCar(); break; case 'sell': sellCar(); break; default: carIndex(); break; } function error($msg) { global $h; echo "<div style='color: #D8000C;background-color: #FFBABA;border: 1px solid;background-repeat: no-repeat;background-position: 10px center;width: 40%;border-radius: 15px;margin: 10px 0;padding: 15px 10px 15px 50px;'><strong>ERROR!</strong><br />",$msg,"<br /><a onclick='window.history.go(-1);' style='cursor:pointer;'>Back</a> · <a href='index' style='color:black;'>Home</a></div>"; $h->endpage(); exit; } function success($msg) { echo "<div style='color: #4F8A10;background-color: #DFF2BF;border: 1px solid;background-repeat: no-repeat;background-position: 10px center;width: 40%;border-radius: 15px;margin: 10px 0;padding: 15px 10px 15px 50px;'><strong>Success!</strong><br />",$msg,"<br /><a onclick='window.history.go(-1);' style='cursor:pointer;'>Back</a> · <a href='index' style='color:black;'>Home</a></div>"; } function format($str, $dec = 0) { return ctype_digit($str) ? number_format($str, $dec) : stripslashes(htmlspecialchars($str)); } function carIndex() { global $db, $ir; $selectGarage = $db->query(sprintf("SELECT `pg`.`pgCapacity`, `g`.* " . "FROM `playerGarages` AS `pg` " . "LEFT JOIN `garages` AS `g` ON (`pg`.`pgType` = `g`.`gTypeID`) " . "WHERE (`pg`.`pgUser` = %u)", $ir['userid'])); if(!$db->num_rows($selectGarage)) { header("Location: garage.php?action=buy"); exit; } $garage = $db->fetch_row($selectGarage); $selectCars = $db->query(sprintf("SELECT `pc`.*, `c`.`cName`, `c`.`cDesc` " . "FROM `playerCars` AS `pc` " . "LEFT JOIN `cars` AS `c` ON (`c`.`cID` = `pc`.`pcCarID`) " . "WHERE (`pc`.`pcUser` = %u) " . "ORDER BY `c`.`cName` ASC", $ir['userid'])); ?><h3>Cars: Your <? echo format($garage['gTypeName']); ?></h3> <a href='garage.php?action=upgradegarage'>Upgrade your <? echo format($garage['gTypeName']); ?></a><br /> You have <? echo format($db->num_rows($selectCars)),'/',format($garage['pgCapacity']); ?> cars<br /> <table class='table' width='100%' cellspacing='1'> <tr> <th width='45%'>Car/Description</th> <th width='45%'>Stats</th> <th width='10%'>Links</th> </tr><? if(!$db->num_rows($selectCars)) { echo "<tr><td colspan='3' class='center'>You don't have any cars<br /><a href='cardealer.php'>Go buy one</a></td></tr>"; } else { while($car = $db->fetch_row($selectCars)) { ?><tr> <td><? echo format($car['cName']); ?><br /><br /><? echo nl2br(format($car['cDesc'])); ?></td> <td><table class='table' width='100%' cellspacing='1'> <tr> <th width='20%'>Speed</th> <td width='30%'><? echo format($car['pcSpeed']); ?></td> <th width='20%'>Handling</th> <td width='30%'><? echo format($car['pcHandling']); ?></td> </tr> <tr> <th width='20%'>Acceleration</th> <td width='30%'><? echo format($car['pcAccel']); ?></td> <th width='20%'>Braking</th> <td width='30%'><? echo format($car['pcBrake']); ?></td> </tr> </table></td> <td><a href='garage.php?action=upgrade&ID=<? echo $car['pcID']; ?>'>Upgrade</a> · <a href='garage.php?action=sell&ID=<? echo $car['pcID']; ?>'>Sell</a><br /><a href='carrace.php?ID=<? echo $car['pcID']; ?>'>Race</a></td> </tr><? } } echo "</table>"; } function upgradeCar() { global $db, $ir; $selectGarage = $db->query(sprintf("SELECT `pg`.`pgCapacity`, `g`.* " . "FROM `playerGarages` AS `pg` " . "LEFT JOIN `garages` AS `g` ON (`pg`.`pgType` = `g`.`gTypeID`) " . "WHERE (`pg`.`pgUser` = %u)", $ir['userid'])); if(!$db->num_rows($selectGarage)) { header("Location: garage.php?action=buy"); exit; } $garage = $db->fetch_row($selectGarage); if(empty($_GET['ID'])) { error("You didn't select a valid car"); } $selectMyCar = $db->query(sprintf("SELECT * FROM `playerCars` WHERE ((`pcID` = %u) AND (`pcUser` = %u))", $_GET['ID'], $ir['userid'])); if(!$db->num_rows($selectMyCar)) { error("You don't own that car"); } $myCar = $db->fetch_row($selectMyCar); $selectStandardCar = $db->query(sprintf("SELECT * FROM `cars` WHERE (`cID` = %u)", $myCar['pcCarID'])); if(!$db->num_rows($selectStandardCar)) { error("That car doesn't exist - message a staff member to inform them about this"); } $car = $db->fetch_row($selectStandardCar); ?><h3>Cars: Upgrading your <? echo format($car['cName']); ?></h3><? $tuneArray = array('speed', 'handling', 'accel', 'brake'); $_GET['tune'] = isset($_GET['tune']) && ctype_alpha($_GET['tune']) && in_array($_GET['tune'], $tuneArray) ? strtolower(trim($_GET['tune'])) : null; if(empty($_GET['tune'])) { ?><table class='table' width='75%' cellspacing='1'> <tr> <th width='20%'>Stat</th> <th width='60%'>Amount</th> <th width='20%'>Tune</th> </tr> <tr> <th>Speed</th> <td><? echo format($myCar['pcSpeed']); ?></td> <td>Cost: <? echo format($myCar['pcSpeed'] * 2); ?><br /><a href='garage.php?action=upgrade&ID=<? echo $_GET['ID']; ?>&tune=speed'>Tune</a></td> </tr> <tr> <th>Handling</th> <td><? echo format($myCar['pcHandling']); ?></td> <td>Cost: <? echo format($myCar['pcHandling'] * 2); ?><br /><a href='garage.php?action=upgrade&ID=<? echo $_GET['ID']; ?>&tune=handling'>Tune</a></td> </tr> <tr> <th>Acceleration</th> <td><? echo format($myCar['pcAccel']); ?></td> <td>Cost: <? echo format($myCar['pcAccel'] * 2); ?><br /><a href='garage.php?action=upgrade&ID=<? echo $_GET['ID']; ?>&tune=accel'>Tune</a></td> </tr> <tr> <th>Braking</th> <td><? echo format($myCar['pcBrake']); ?></td> <td>Cost: <? echo format($myCar['pcBrake'] * 2); ?><br /><a href='garage.php?action=upgrade&ID=<? echo $_GET['ID']; ?>&tune=brake'>Tune</a></td> </tr> </table><? } else { $rand = mt_rand(1, 5); $uhOh = ''; switch($_GET['tune']) { case 'speed': if(($myCar['pcSpeed'] * 2) > $ir['money']) { error("You don't have enough to pay for that upgrade"); } if($rand >= 3) { $tuneThis = array('handling', 'accel', 'brake'); shuffle($tuneThis); $randReturn = $tuneThis[0]; $db->query(sprintf("UPDATE `playerCars` SET `pc%s` = GREATEST(`pc%s` - %u, 0) WHERE (`pcID` = %u)", ucfirst($randReturn), ucfirst($randReturn), mt_rand(10, 50), $_GET['ID'])); if($randReturn == 'accel') { $randString = 'acceleration'; } else if($randReturn == 'brake') { $randString = 'braking'; } else { $randString = $randReturn; } $uhOh .= ' at the cost of your '.$randString; } $db->query(sprintf("UPDATE `playerCars` SET `pcSpeed` = `pcSpeed` + %u WHERE (`pcID` = %u)", (mt_rand(25, 100) * $ir['level']), $_GET['ID'])); $db->query(sprintf("UPDATE `users` SET `money` = `money` - %u WHERE (`userid` = %u)", ($myCar['pcSpeed'] * 2), $ir['userid'])); success("You've upgraded your speed".$uhOh); break; case 'handling': if(($myCar['pcHandling'] * 2) > $ir['money']) { error("You don't have enough to pay for that upgrade"); } if($rand >= 3) { $tuneThis = array('speed', 'accel', 'brake'); shuffle($tuneThis); $randReturn = $tuneThis[0]; $db->query(sprintf("UPDATE `playerCars` SET `pc%s` = GREATEST(`pc%s` - %u, 0) WHERE (`pcID` = %u)", ucfirst($randReturn), ucfirst($randReturn), mt_rand(10, 50), $_GET['ID'])); if($randReturn == 'accel') { $randString = 'acceleration'; } else if($randReturn == 'brake') { $randString = 'braking'; } else { $randString = $randReturn; } $uhOh .= ' at the cost of your '.$randString; } $db->query(sprintf("UPDATE `playerCars` SET `pcHandling` = `pcHandling` + %u WHERE (`pcID` = %u)", (mt_rand(25, 100) * $ir['level']), $_GET['ID'])); $db->query(sprintf("UPDATE `users` SET `money` = `money` - %u WHERE (`userid` = %u)", ($myCar['pcHandling'] * 2), $ir['userid'])); success("You've upgraded your handling".$uhOh); break; case 'accel': if(($myCar['pcAccel'] * 2) > $ir['money']) { error("You don't have enough to pay for that upgrade"); } if($rand >= 3) { $tuneThis = array('speed', 'handling', 'brake'); shuffle($tuneThis); $randReturn = $tuneThis[0]; $db->query(sprintf("UPDATE `playerCars` SET `pc%s` = GREATEST(`pc%s` - %u, 0) WHERE (`pcID` = %u)", ucfirst($randReturn), ucfirst($randReturn), mt_rand(10, 50), $_GET['ID'])); if($randReturn == 'accel') { $randString = 'acceleration'; } else if($randReturn == 'brake') { $randString = 'braking'; } else { $randString = $randReturn; } $uhOh .= ' at the cost of your '.$randString; } $db->query(sprintf("UPDATE `playerCars` SET `pcAccel` = `pcAccel` + %u WHERE (`pcID` = %u)", (mt_rand(25, 100) * $ir['level']), $_GET['ID'])); $db->query(sprintf("UPDATE `users` SET `money` = `money` - %u WHERE (`userid` = %u)", ($myCar['pcAccel'] * 2), $ir['userid'])); success("You've upgraded your acceleration".$uhOh); break; case 'brake': if(($myCar['pcBrake'] * 2) > $ir['money']) { error("You don't have enough to pay for that upgrade"); } if($rand >= 3) { $tuneThis = array('speed', 'handling', 'accel'); shuffle($tuneThis); $randReturn = $tuneThis[0]; $db->query(sprintf("UPDATE `playerCars` SET `pc%s` = GREATEST(`pc%s` - %u, 0) WHERE (`pcID` = %u)", ucfirst($randReturn), ucfirst($randReturn), mt_rand(10, 50), $_GET['ID'])); if($randReturn == 'accel') { $randString = 'acceleration'; } else if($randReturn == 'brake') { $randString = 'braking'; } else { $randString = $randReturn; } $uhOh .= ' at the cost of your '.$randString; } $db->query(sprintf("UPDATE `playerCars` SET `pcBrake` = `pcBrake` + %u WHERE (`pcID` = %u)", (mt_rand(25, 100) * $ir['level']), $_GET['ID'])); $db->query(sprintf("UPDATE `users` SET `money` = `money` - %u WHERE (`userid` = %u)", ($myCar['pcBrake'] * 2), $ir['userid'])); success("You've upgraded your braking".$uhOh); break; } } } function upgradeGarage() { global $db, $ir; $selectGarage = $db->query(sprintf("SELECT `pg`.`pgCapacity`, `g`.* " . "FROM `playerGarages` AS `pg` " . "LEFT JOIN `garages` AS `g` ON (`pg`.`pgType` = `g`.`gTypeID`) " . "WHERE (`pg`.`pgUser` = %u)", $ir['userid'])); if(!$db->num_rows($selectGarage)) { header("Location: garage.php?action=buy"); exit; } $garage = $db->fetch_row($selectGarage); if(!empty($_GET['ID'])) { $select = $db->query(sprintf("SELECT `gTypeName`, `gTypeCost` FROM `garages` WHERE (`gTypeID` = %u)", $_GET['ID'])); if(!$db->num_rows($select)) { error("That upgrade doesn't exist"); } $gar = $db->fetch_row($select); if($gar['gTypeCost'] > $ir['money']) { error("You don't have enough money for that"); } $db->query(sprintf("UPDATE `playerGarages` SET `pgType` = %u WHERE (`pgUser` = %u)", $_GET['ID'], $ir['userid'])); success("You've bought the ".format($gar['gTypeName'])); } $getGarageUpgrades = $db->query(sprintf("SELECT * FROM `garages` WHERE (`gTypeID` > %u)", $garage['gTypeID'])); ?><h3>Cars: Upgrading your <? echo format($garage['gTypeName']); ?></h3> <table class='table' width='75%' cellspacing='1'> <tr> <th width='40%'>Upgrade</th> <th width='40%'>Cost</th> <th width='20%'>Links</th> </tr><? if(!$db->num_rows($getGarageUpgrades)) { echo "<tr><td colspan='3' class='center'>There are no upgrades available</td></tr>"; } else { while($upg = $db->fetch_row($getGarageUpgrades)) { ?><tr> <td><? echo format($upg['gTypeName']); ?></td> <td>$<? echo format($upg['gTypeCost']); ?></td> <td><? echo ($ir['money'] >= $upg['gTypeCost']) ? "<a href='garage.php?action=upgradegarage&ID=".$upg['gTypeID']."'>Buy</a>" : "<span style='color:#444;'>Buy</span>"; ?></td> </tr><? } } echo "</table>"; } function sellCar() { global $db, $ir; $selectGarage = $db->query(sprintf("SELECT `pg`.`pgCapacity`, `g`.* " . "FROM `playerGarages` AS `pg` " . "LEFT JOIN `garages` AS `g` ON (`pg`.`pgType` = `g`.`gTypeID`) " . "WHERE (`pg`.`pgUser` = %u)", $ir['userid'])); if(!$db->num_rows($selectGarage)) { header("Location: garage.php?action=buy"); exit; } if(empty($_GET['ID'])) { error("You didn't select a valid car"); } $selectMyCar = $db->query(sprintf("SELECT * FROM `playerCars` WHERE ((`pcID = %u) AND (`pcUser` = %u))", $_GET['ID'], $ir['userid'])); if(!$db->num_rows($selectMyCar)) { error("You don't own that car"); } $myCar = $db->fetch_row($selectMyCar); $selectStandardCar = $db->query(sprintf("SELECT * FROM `cars` WHERE (`cID` = %u)", $myCar['pcCarID'])); if(!$db->num_rows($selectStandardCar)) { error("That car doesn't exist - message a staff member to inform them about this"); } $stdCar = $db->fetch_row($selectStandardCar); $myTotalStats = $myCar['pcSpeed'] + $myCar['pcHandling'] + $myCar['pcAccel'] + $myCar['pcBrake']; $stdTotalStats = $stdCar['cSpeed'] + $stdCar['cHandling'] + $stdCar['cAccel'] + $stdCar['cBrake']; if(($myTotalStats >= $stdTotalStats) && ($myTotalStats <= ($stdTotalStats + 500))) { $cost = $stdCar['cCost'] / 2; } else if(($myTotalStats >= ($stdTotalStats + 501)) && $myTotalStats <= ($stdTotalStats + 1500)) { $cost = $stdCar['cCost']; } else if(($myTotalStats >= ($stdTotalStats + 1501)) && $myTotalStats <= ($stdTotalStats * 2)) { $cost = ($stdCar['cCost'] * 2) - (($stdCar['cCost'] / 100) * 33); } else if(($myTotalStats >= ($stdTotalStats * 2) + 1) && $myTotalStats <= ($stdTotalStats * 5)) { $cost = $stdCar['cCost'] * 3; } else if(($myTotalStats >= ($stdTotalStats * 5) + 1) && $myTotalStats <= ($stdTotalStats * 10)) { $cost = $stdCar['cCost'] * 3; } else if($myTotalStats >= ($stdTotalStats * 10) + 1) { $cost = $stdCar['cCost'] * 5; } ?><h3>Cars: Selling your <? echo format($stdCar['cName']); ?></h3><? if(!isset($_GET['ans'])) { ?>If you sell your car, you will receive $<? echo format($cost); ?><br /> Are you sure you want to do this?<br /> <a href='garage.php?action=sell&ID=<? echo $_GET['ID']; ?>&ans=yes'>Yes</a> · <a href='garage.php'>No</a><? } else { $db->query(sprintf("DELETE FROM `playerCars` WHERE (`pcID` = %u)", $_GET['ID'])); $db->query(sprintf("UPDATE `users` SET `money` = `money` + %u WHERE (`userid` = %u)", $cost, $ir['userid'])); success("You've sold your ".format($stdCar['cName'])." for \$".format($cost)); } } function buyGarage() { global $db, $ir; $selectGarage = $db->query(sprintf("SELECT `pg`.`pgCapacity`, `g`.* " . "FROM `playerGarages` AS `pg` " . "LEFT JOIN `garages` AS `g` ON (`pg`.`pgType` = `g`.`gTypeID`) " . "WHERE (`pg`.`pgUser` = %u)", $ir['userid'])); if($db->num_rows($selectGarage)) { header("Location: garage.php"); exit; } $select = $db->query("SELECT `gTypeName`, `gTypeCost` FROM `garages` WHERE (`gTypeID` = 1)"); $gar = $db->fetch_row($select); ?><h3>Cars: Buying your first <? echo format($gar['gTypeName']); ?></h3><? if($gar['gTypeCost'] > $ir['money']) { error("You don't have enough money to do that. It costs ".format($gar['gTypeCost'])); } $db->query(sprintf("INSERT INTO `playerGarages` VALUES ('', %u, 1, 1)", $ir['userid'])); success("You've bought your ".format($gar['gTypeName'])); } $h->endpage(); ?> Edited May 20, 2013 by Magictallguy Added in "Race" link Quote Link to comment Share on other sites More sharing options...
Razor42 Posted May 21, 2013 Author Share Posted May 21, 2013 Any update on when this is going to be finished MTG? :) Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted May 21, 2013 Share Posted May 21, 2013 Any update on when this is going to be finished MTG? :) Working on it now.. Just really struggling with a 5 month old boy who's just found his voice -.- Quote Link to comment Share on other sites More sharing options...
secret_life Posted November 4, 2013 Share Posted November 4, 2013 Up Any update on when this is going to be finished MTG? Quote Link to comment Share on other sites More sharing options...
Sim Posted November 5, 2013 Share Posted November 5, 2013 $175 and ill start tonight secret life Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted November 5, 2013 Share Posted November 5, 2013 $175 and ill start tonight secret life I'd take that offer.. Chances are I'm not going to be able to finish it :/ Quote Link to comment Share on other sites More sharing options...
dnenb Posted April 13, 2014 Share Posted April 13, 2014 How much do you want to finish this mod, MTG? Quote Link to comment Share on other sites More sharing options...
assault14 Posted August 17, 2015 Share Posted August 17, 2015 :( I was so looking forward to looking for this completion! it looked so promessing!!! Quote Link to comment Share on other sites More sharing options...
jcvenom Posted August 17, 2015 Share Posted August 17, 2015 Whats files are left to finish? i will finish the rest or assist Quote Link to comment Share on other sites More sharing options...
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.