Quote:
Originally Posted by edox77
i click in gg and get ammo :P in shop cant get ammo but gg can :P
|
this is because GG use table server_1_player_all_item and shop use table server_1_player_ammunation.
See:
GG
PHP Code:
private function addItems($args){
$lootIds = array('2'=>'ammunition_laser_mcb-25', '3'=>'ammunition_laser_mcb-50', '4'=>'ammunition_laser_ucb-100', '5'=>'ammunition_laser_sab-50','12'=>'ammunition_rocket_plt-2021','11'=>'ammunition_mine_acm-01');
foreach($args as $k => $r){
if(array_key_exists($r['id'], $lootIds)):
$li = $lootIds[$r['id']];
if(self::checkExistence($li)):
if(!empty($r['q'])):
$Q = $r['q'];
$sqli = "UPDATE `server_1_player_all_items` SET Q = Q + $Q WHERE userID=? && playerID=? && lootid=?";
$stmt = $this->con->prepare($sqli);
$stmt->bindParam(1, $this->userid, PDO::PARAM_INT);
$stmt->bindParam(2, $this->playerid, PDO::PARAM_INT);
$stmt->bindParam(3, $li, PDO::PARAM_STR);
$stmt->execute();
endif;
else:
if(!empty($r['q'])):
$in = 0;
$Q = $r['q'];
$sql = "INSERT INTO `server_1_player_all_items` (`lootid`, `Q`, `interactive`, `playerID`, `userID`) VALUES (?, ?, ?, ?, ?)";
$stmt = $this->con->prepare($sql);
$stmt->bindParam(1, $li, PDO::PARAM_STR);
$stmt->bindParam(2, $Q, PDO::PARAM_INT);
$stmt->bindParam(3, $in, PDO::PARAM_INT);
$stmt->bindParam(4, $this->playerid, PDO::PARAM_INT);
$stmt->bindParam(5, $this->userid, PDO::PARAM_INT);
$stmt->execute();
endif;
endif;
endif;
}
return true;
}
Shop:
PHP Code:
private function updateAmmo($am, $full){
$sqli = "UPDATE server_1_player_ammunation SET $full = ($full+$am) WHERE playerID=:pid";
$stmt = $this->con->prepare($sqli);
$stmt->bindParam(':pid', $this->pid, PDO::PARAM_INT);
if ($stmt->execute()) {
$message = '{"result":"success","message":"' . $am . 'x ammunition: \"' . $name . '\" purchased.<br \/><br \/>","showEquipOption":false,"userBalance":{"uridium":' . $this->uridium . ',"credits":' . $this->credits . '},"userShip":{"laserAmmunitionSpace":100000000,"rocketSpace":100000000},"isShipDumpEmpty":false,"itemId":"' . $id . '","category":"ammunition"}';
return $message;
}else{
$message = '{"result":"error","message":"S.H.E.I.L.D. found a bug on your account, contact staff.","userBalance":{"uridium":' . $this->uridium . ',"credits":' . $this->credits . '},"userShip":{"laserAmmunitionSpace":0,"rocketSpace":0},"isShipDumpEmpty":false,"itemId":"' . $id . '","category":"ship"}';
return $message;
}
}
Emulator use the server_1_player_ammunation.
PD: How do you fix the chat, I start the chat emulator, I edit the xml config files but chat doesn't connect to the emu (Only the in-game chat client doesn't works, the acp chat connection works)