Schrotthändler werden keine gebühren berechnet

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • sven wrote:

      yes my friend but who is my mistake?i cant find it
      Pero para eso debes agregar algunas cosas, no esta del todo terminado, solo puse una condición para mostrar solo el error, pero para que descuente la materias oscura se debe añadir algunas cosas mas,
      VERY SAD :/ :/ :/ :/
    • Remplaza el contenido de ShowFleetDealerPage.class.php por

      PHP Source Code

      1. <?php
      2. /**
      3. * 2Moons
      4. * by Jan-Otto Kröpke 2009-2016
      5. *
      6. * For the full copyright and license information, please view the LICENSE
      7. *
      8. * @package 2Moons
      9. * @author Jan-Otto Kröpke <slaver7@gmail.com>
      10. * @copyright 2009 Lucky
      11. * @copyright 2016 Jan-Otto Kröpke <slaver7@gmail.com>
      12. * @licence MIT
      13. * @version 1.8.0
      14. * @link https://github.com/jkroepke/2Moons
      15. */
      16. class ShowFleetDealerPage extends AbstractGamePage
      17. {
      18. public static $requireModule = MODULE_FLEET_TRADER;
      19. function __construct()
      20. {
      21. parent::__construct();
      22. }
      23. public function send()
      24. {
      25. global $USER, $PLANET, $LNG, $pricelist, $resource;
      26. if ($USER['darkmatter'] < Config::get()->darkmatter_cost_trader) {
      27. $this->redirectTo('game.php?page=overview');
      28. }
      29. $shipID = HTTP::_GP('shipID', 0);
      30. $Count = max(0, round(HTTP::_GP('count', 0.0)));
      31. $allowedShipIDs = explode(',', Config::get()->trade_allowed_ships);
      32. if(!empty($shipID) && !empty($Count) && in_array($shipID, $allowedShipIDs) && $PLANET[$resource[$shipID]] >= $Count)
      33. {
      34. $tradeCharge = 1 - (Config::get()->trade_charge / 100);
      35. $PLANET[$resource[901]] += $Count * $pricelist[$shipID]['cost'][901] * $tradeCharge;
      36. $PLANET[$resource[902]] += $Count * $pricelist[$shipID]['cost'][902] * $tradeCharge;
      37. $PLANET[$resource[903]] += $Count * $pricelist[$shipID]['cost'][903] * $tradeCharge;
      38. $USER[$resource[921]] += $Count * $pricelist[$shipID]['cost'][921] * $tradeCharge;
      39. $PLANET[$resource[$shipID]] -= $Count;
      40. $USER[$resource[921]] -= Config::get()->darkmatter_cost_trader;
      41. $sql = 'UPDATE %%PLANETS%% SET '.$resource[$shipID].' = '.$resource[$shipID].' - :count WHERE id = :planetID;';
      42. Database::get()->update($sql, array(
      43. ':count' => $Count,
      44. ':planetID' => $PLANET['id']
      45. ));
      46. $this->printMessage($LNG['tr_exchange_done'], array(array(
      47. 'label' => $LNG['sys_forward'],
      48. 'url' => 'game.php?page=fleetDealer'
      49. )));
      50. }
      51. else
      52. {
      53. $this->printMessage($LNG['tr_exchange_error'], array(array(
      54. 'label' => $LNG['sys_back'],
      55. 'url' => 'game.php?page=fleetDealer'
      56. )));
      57. }
      58. }
      59. function show()
      60. {
      61. global $PLANET, $LNG, $pricelist, $resource, $reslist, $USER;
      62. $Cost = array();
      63. $darkmatter_cost_trader = Config::get()->darkmatter_cost_trader;
      64. $allowedShipIDs = explode(',', Config::get()->trade_allowed_ships);
      65. foreach($allowedShipIDs as $shipID)
      66. {
      67. if(in_array($shipID, $reslist['fleet']) || in_array($shipID, $reslist['defense'])) {
      68. $Cost[$shipID] = array($PLANET[$resource[$shipID]], $LNG['tech'][$shipID], $pricelist[$shipID]['cost']);
      69. }
      70. }
      71. if(empty($Cost))
      72. {
      73. $this->printMessage($LNG['ft_empty'], array(array(
      74. 'label' => $LNG['sys_back'],
      75. 'url' => 'game.php?page=fleetDealer'
      76. )));
      77. }
      78. $this->assign(array(
      79. 'shipIDs' => $allowedShipIDs,
      80. 'CostInfos' => $Cost,
      81. 'Charge' => Config::get()->trade_charge,
      82. 'requiredDarkMatter' => $USER['darkmatter'] < $darkmatter_cost_trader ? sprintf($LNG['tr_not_enought'], $LNG['tech'][921]) : false,
      83. 'tr_cost_dm_trader' => sprintf($LNG['tr_cost_dm_trader'], pretty_number($darkmatter_cost_trader), $LNG['tech'][921]),
      84. ));
      85. $this->display('page.fleetDealer.default.tpl');
      86. }
      87. }
      Display All
      Y el tpl por el adjunto.
      Files
      VERY SAD :/ :/ :/ :/