Spy Probe Limit?

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

    • to make it all you need to add it in the conditions when sending in fleet attack
      I remain at your disposal on the forum for any questions or help.

      A help is of course not a creation of a mod



      -------------------------------------------------------
      Spaccon 1.0 will be version 3.0 of 2moons that I'm coding
      Demo and coding 2moons 2.0
    • Write a sql query which counts the amount of attacks with spy probes within the last 24 hours and then check if the count is less than your wanted limit, best place would be fleetStep3.php probably.
    • FleetStep3 and FleetAjax (because the quickspy button on galaxy).


      Source Code

      1. $sql = "SELECT COUNT(*) AS total FROM %%LOG_FLEETS%% where `fleet_mission` = 6 AND `fleet_owner` = :fleet_owner AND `fleet_end_galaxy` = :fleet_end_galaxy and `fleet_end_system` = :fleet_end_system and `fleet_end_planet` = :fleet_end_planet and `fleet_end_stay` > UNIX_TIMESTAMP(NOW() - INTERVAL 1 DAY)";
      2. $Spy = Database::get()->selectSingle($sql, array(
      3. 'fleet_owner' => $USER['id'],
      4. 'fleet_end_galaxy' => $galaxy,
      5. 'fleet_end_system' => $system,
      6. 'fleet_end_planet' => $planet
      7. ), 'total');
      This is the query you need
      Looking for good VPS to host your game? Use DigitalOcean and get 100$ bonus credit for 2 months!

      Private project - stellaron.space

      I can build any mod. Need my service? Contact me via PM
    • use class.fleetfunctions for mission option, you still need to edit fleetajax if you want to limit spy mission
      Looking for good VPS to host your game? Use DigitalOcean and get 100$ bonus credit for 2 months!

      Private project - stellaron.space

      I can build any mod. Need my service? Contact me via PM
    • Qwa wrote:

      use class.fleetfunctions for mission option, you still need to edit fleetajax if you want to limit spy mission
      i change fleetfunctions but it gives errror $fleetShipCountt

      if (!$YourPlanet) {
      if(isModuleAvailable(MODULE_MISSION_ATTACK))
      if($MissionInfo['Ship'] == 210|| $fleetShipCountt <= 20)
      $availableMissions[] = 1;

      if(isModuleAvailable(MODULE_MISSION_HOLD))
      $availableMissions[] = 5;}
    • you havê the 210| tagged to a number. I never did this, is that causing a problem?
      Looking for good VPS to host your game? Use DigitalOcean and get 100$ bonus credit for 2 months!

      Private project - stellaron.space

      I can build any mod. Need my service? Contact me via PM
    • How did you define the variable "fleetShipCountt" dreams82? Man if you cannot even give us your code in detail, we cannot help you.

      Im not sure if "$MissionInfo" contains that information but its most likely.


      *Edit: Yea it is in $MissionInfo, so you do not even have to code that.



      I just have to ask this: Did you ever code anything in php? I am wondering how you do not know that you cannot imagine the content of a variable in your brain and its there - coding is not magic lol.
    • mission info is always defined no matter what since is a step before fleettable2. Is the double tt intentional on var name?
      Looking for good VPS to host your game? Use DigitalOcean and get 100$ bonus credit for 2 months!

      Private project - stellaron.space

      I can build any mod. Need my service? Contact me via PM
    • public static function GetAvailableMissions($USER, $MissionInfo, $GetInfoPlanet)
      {
      $YourPlanet= (!empty($GetInfoPlanet['id_owner']) && $GetInfoPlanet['id_owner'] == $USER['id']) ? true : false;
      $UsedPlanet= (!empty($GetInfoPlanet['id_owner'])) ? true : false;
      $availableMissions= array();


      if ($MissionInfo['planet'] == (Config::get($USER['universe'])->max_planets + 1) && isModuleAvailable(MODULE_MISSION_EXPEDITION))
      $availableMissions[] = 15;
      elseif ($MissionInfo['planettype'] == 2) {
      if ((isset($MissionInfo['Ship'][209]) || isset($MissionInfo['Ship'][219])) && isModuleAvailable(MODULE_MISSION_RECYCLE) && !($GetInfoPlanet['der_metal'] == 0 && $GetInfoPlanet['der_crystal'] == 0))
      $availableMissions[] = 8;
      } else {
      if (!$UsedPlanet) {
      if (isset($MissionInfo['Ship'][208]) && $MissionInfo['planettype'] == 1 && isModuleAvailable(MODULE_MISSION_COLONY))
      $availableMissions[] = 7;
      } else {
      if(isModuleAvailable(MODULE_MISSION_TRANSPORT))
      $availableMissions[] = 3;

      if (!$YourPlanet && self::OnlyShipByID($MissionInfo['Ship'], 210) && isModuleAvailable(MODULE_MISSION_SPY))
      $availableMissions[] = 6;

      if (!$YourPlanet) {
      if(isModuleAvailable(MODULE_MISSION_ATTACK))
      if($MissionInfo['Ship'] == 210|| $fleetShipCount <= 20) //this line fleetShipCount not value
      $availableMissions[] = 1;

      if(isModuleAvailable(MODULE_MISSION_HOLD))
      $availableMissions[] = 5;}

      elseif(isModuleAvailable(MODULE_MISSION_STATION)) {
      $availableMissions[] = 4;}

      if (!empty($MissionInfo['IsAKS']) && !$YourPlanet && isModuleAvailable(MODULE_MISSION_ATTACK) && isModuleAvailable(MODULE_MISSION_ACS))
      $availableMissions[] = 2;

      if (!$YourPlanet && $MissionInfo['planettype'] == 3 && isset($MissionInfo['Ship'][214]) && isModuleAvailable(MODULE_MISSION_DESTROY))
      $availableMissions[] = 9;

      if ($YourPlanet && $MissionInfo['planettype'] == 3 && self::OnlyShipByID($MissionInfo['Ship'], 220) && isModuleAvailable(MODULE_MISSION_DARKMATTER))
      $availableMissions[] = 11;
      }
      }

      return $availableMissions;
      }
    • Yeaaahhhhh i did :) Thanks everyone.

      I change FleetFunctions line 433

      if (!$YourPlanet) {
      if(isModuleAvailable(MODULE_MISSION_ATTACK))
      if($MissionInfo['Ship'] == 210|| $MissionInfo['Ship'][210] <= 20) //Max:20 Spy



      $availableMissions[] = 1;