[FAQ]More about spy reports?

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

  • [FAQ]More about spy reports?

    In the spy report, i want to show the required number of light cargo ship needed to loot resources.

    Please how to add it to MissionCaseSpy.class.php.
    --------------------------------------------------------------------------------------
  • noonn wrote:

    In the spy report, i want to show the required number of light cargo ship needed to loot resources.

    Please how to add it to MissionCaseSpy.class.php.
    Agrega este codigo a TargetEvent() en MissionCaseSpay.class.php

    PHP Source Code

    1. $needed = 0;
    2. if(!empty($spyData[900])){
    3. $total = 0;
    4. foreach ($spyData[900] as $elementID => $amount) {
    5. $total += round($amount);
    6. }
    7. $ship_needed = $pricelist[202]; #small_ship_cargo
    8. $ship_storage_needed = $ship_needed['capacity'];
    9. $needed = ceil($total / $ship_storage_needed); #ships needed
    10. }
    Display All

    Luego mas abajo pasalo a $template

    PHP Source Code

    1. $template->assign_vars(array(
    2. 'spyData' => $spyData,
    3. 'targetPlanet' => $targetPlanet,
    4. 'targetChance' => $targetChance,
    5. 'spyChance' => $spyChance,
    6. 'isBattleSim' => ENABLE_SIMULATOR_LINK == true && isModuleAvailable(MODULE_SIMULATOR),
    7. 'title' => sprintf($LNG['sys_mess_head'], $targetPlanet['name'], $targetPlanet['galaxy'], $targetPlanet['system'], $targetPlanet['planet'], _date($LNG['php_tdformat'], $this->_fleet['fleet_end_time'], $targetUser['timezone'], $LNG)),
    8. 'needed' => $needed #here add small_cargo_ships
    9. ));
    Gestor de proyectos para xampp
    Cardinal System for XAMPP
  • Jekill wrote:

    noonn wrote:

    In the spy report, i want to show the required number of light cargo ship needed to loot resources.

    Please how to add it to MissionCaseSpy.class.php.
    Agrega este codigo a TargetEvent() en MissionCaseSpay.class.php

    PHP Source Code

    1. $needed = 0;
    2. if(!empty($spyData[900])){
    3. $total = 0;
    4. foreach ($spyData[900] as $elementID => $amount) {
    5. $total += round($amount);
    6. }
    7. $ship_needed = $pricelist[202]; #small_ship_cargo
    8. $ship_storage_needed = $ship_needed['capacity'];
    9. $needed = ceil($total / $ship_storage_needed); #ships needed
    10. }
    Display All
    Luego mas abajo pasalo a $template

    PHP Source Code

    1. $template->assign_vars(array(
    2. 'spyData' => $spyData,
    3. 'targetPlanet' => $targetPlanet,
    4. 'targetChance' => $targetChance,
    5. 'spyChance' => $spyChance,
    6. 'isBattleSim' => ENABLE_SIMULATOR_LINK == true && isModuleAvailable(MODULE_SIMULATOR),
    7. 'title' => sprintf($LNG['sys_mess_head'], $targetPlanet['name'], $targetPlanet['galaxy'], $targetPlanet['system'], $targetPlanet['planet'], _date($LNG['php_tdformat'], $this->_fleet['fleet_end_time'], $targetUser['timezone'], $LNG)),
    8. 'needed' => $needed #here add small_cargo_ships
    9. ));


    The code works fine.
    You are amazing.
    thank you ^^
    :D :D :D
    --------------------------------------------------------------------------------------