Yes when I go home from work I gona post here.
So I tried your solution for the tuning mode but no working Coming up one error like this, when I try to buy the exhaust for the car .
Sorry something went very wrong!
The error has been logged and waiting for a developer to review this issue.
If you are the developer you can enable better dubuging by editing config.php and enabling debug.
Sim I try your solution as well but also no working.
Sorry something went very wrong!
The error has been logged and waiting for a developer to review this issue.
If you are the developer you can enable better dubuging by editing config.php and enabling debug
With this solution working now for me. I know its not the best solution.Now I just need to add to don't let peoples to buy more than 1 tuning part for each car.
public function method_exhaust() {
$car = $this->db->prepare("SELECT * FROM garage INNER JOIN cars ON (CA_id = GA_car) WHERE GA_id = :car");
$car->bindParam(':car', $this->methodData->car);
$car->execute();
$car = $car->fetchObject();
if (empty($car) || $car->GA_uid != $this->user->id) {
$this->alerts[] = $this->page->buildElement('error', array("text"=>'Car doesnt exist'));
} else if ($this->user->info->US_money <= 0) {
$this->alerts[] = $this->page->buildElement('error', array("text" => "Not enough money!"));
} else if ($this->garage->info->GA_exhaust == 100) {
$this->alerts[] = $this->page->buildElement('error', array("text" => "You all ready have this"));
} else {
if ($value < $this->user->info->US_money) {
$this->alerts[] = $this->page->buildElement('success', array("text"=>'You buyed exhaust tuning.'));
$this->db->query("UPDATE garage SET GA_exhaust = GA_exhaust + 100 WHERE GA_id = ".$car->GA_id);
$this->db->query("UPDATE userStats SET US_money = US_money - 1000000 WHERE US_id = ".$this->user->id);
$actionHook = new hook("userAction");
$action = array(
"user" => $this->user->id,
"module" => "tuning.exhaust",
"id" => $car->CA_id,
"success" => true,
"reward" => $value
);
$actionHook->run($action);
}
}
}