Fortress and asteroid

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

  • Fortress and asteroid

    Hello.
    How to make it work for all uni and I have 5?
    It only works for 1 uni. :thumbup:

    PHP Source Code

    1. //BEGIN ASTEROID EVENT
    2. if($CONF['asteroid_event'] < TIMESTAMP){
    3. $GLOBALS['DATABASE']->query("DELETE FROM ".PLANETS." where `id_owner` = '".Asteroid_Id."' AND `id` != '706' ;");
    4. $galaxy = $this->randRange(1,5,5);
    5. $system = $this->randRange(1,200,70);
    6. foreach($system as $System_Element){
    7. $planets = rand(1,15);
    8. $cautare = $GLOBALS['DATABASE']->query("SELECT *FROM ".PLANETS." where `galaxy` = '".$Element."' and `system` = '".$System_Element."' and `planet` = '".$planets."' AND `universe` = '".$UNI."';");
    9. if($GLOBALS['DATABASE']->numRows($cautare)==0){
    10. $metal_rand = Config::get('asteroid_metal');
    11. $crystal_rand = Config::get('asteroid_crystal');
    12. $deuterium_rand= Config::get('asteroid_deuterium');
    13. $GLOBALS['DATABASE']->query("INSERT INTO ".PLANETS."(`name`,`id_owner`,`universe`,`galaxy`,`system`,`planet`,`planet_type`,`image`,`diameter`,`der_metal`,`der_crystal`,`der_deuterium`,`last_update`)
    14. VALUES('Asteroid','".Asteroid_Id."','".$UNI."','".$Element."','".$System_Element."','".$planets."','1','asteroid','9800','".$metal_rand."','".$crystal_rand."','".$deuterium_rand."','".TIMESTAMP."');");
    15. }
    16. }
    17. $totalPremiums = $GLOBALS['DATABASE']->query("SELECT DISTINCT `id`, `lang` FROM ".USERS.";");
    18. $langObjects = array();
    19. while($xy = $GLOBALS['DATABASE']->fetch_array($totalPremiums)){
    20. if(!isset($langObjects[$xy['lang']]))
    21. {
    22. $langObjects[$xy['lang']] = new Language($xy['lang']);
    23. $langObjects[$xy['lang']]->includeData(array('L18N', 'INGAME', 'TECH', 'CUSTOM'));
    24. }
    25. $LNG = $langObjects[$xy['lang']];
    26. $message = '<div style="text-align:justify;">'.$LNG['sys_asteroid_3'].'</div><div class="citation"><div class="guillemet ouvrir"></div><div class="guillemet fermer"></div><ul style="text-align : left;">'.$LNG['sys_asteroid_4'].'</ul></div><div class="explication_utilisateur">'.$LNG['ls_fts_colo_9'].'</div>';
    27. SendSimpleMessage($xy['id'], 0, TIMESTAMP, 7, $LNG['sys_asteroid_1'], $LNG['sys_asteroid_2'], $message);
    28. }
    29. $newevkaka = $CONF['asteroid_event'] + 60*60*24;
    30. $GLOBALS['DATABASE']->query("UPDATE ".CONFIG." SET asteroid_event = '".$newevkaka."' where `uni` = '".$UNI."';");
    31. }
    32. //END ASTEROID EVENT
    33. //BEGIN FORTRESS EVENT
    34. if($CONF['fortress_event'] < (TIMESTAMP - 86400)){
    35. $GLOBALS['DATABASE']->query("DELETE FROM ".PLANETS." where `planet_type` = '4' AND `id` != '706' ;");
    36. $galaxy = $this->randRange(1,5,5);
    37. foreach($galaxy as $Element){
    38. $system = $this->randRange(1,200,70);
    39. foreach($system as $System_Element){
    40. $planets = rand(1,15);
    41. $timerforall = TIMESTAMP + 4*60*60*6;
    42. $cautare = $GLOBALS['DATABASE']->query("SELECT *FROM ".PLANETS." where `galaxy` = '".$Element."' and `system` = '".$System_Element."' and `planet` = '".$planets."' AND `universe` = '".$UNI."';");
    43. if($GLOBALS['DATABASE']->numRows($cautare)==0){
    44. $metal_rand = Config::get('asteroid_metal');
    45. $crystal_rand = Config::get('asteroid_crystal');
    46. $deuterium_rand= Config::get('asteroid_deuterium');
    47. $max_field= mt_rand(69,176);
    48. $GLOBALS['DATABASE']->query("INSERT INTO ".PLANETS."(`name`,`id_owner`,`universe`,`galaxy`,`system`,`planet`,`planet_type`,`image`,`diameter`,`field_current`,`field_max`,`metal`,`crystal`,`deuterium`,`last_update`,`capture_not`)
    49. VALUES('Fortress Planet','".Fortress_Id."','".$UNI."','".$Element."','".$System_Element."','".$planets."','4','fortress','9800','0','".$max_field."','".$metal_rand."','".$crystal_rand."','".$deuterium_rand."','".TIMESTAMP."','".$timerforall."');");
    50. }
    51. }
    52. }
    53. $totalPremiums = $GLOBALS['DATABASE']->query("SELECT DISTINCT `id` FROM ".USERS.";");
    54. while($xy = $GLOBALS['DATABASE']->fetch_array($totalPremiums)){
    55. $message = "<span class='admin'>Fortress Event started<br>
    56. Capture your fortress and take advantage of the profits they offer you !<br><br>
    57. Evenement Fortress a commencer<br>
    58. Capturez votre forteresse et profiter des multiple avantage qu\'elles peuvent vous offrir !
    59. </span>";
    60. SendSimpleMessage($xy['id'], 1, TIMESTAMP, 50, "Event System", "Event Info", $message);
    61. }
    62. $newevkaka = $timerforall + 84200;
    63. $GLOBALS['DATABASE']->query("UPDATE ".CONFIG." SET fortress_event = '".$newevkaka."' where `uni` = '".$UNI."';");
    64. }
    65. //END FORTRESS EVENT
    Display All
  • I also have trouble sending recycles to the asteroid.
    Asteroid is, the damage field also but when the message pops up the message 'No damage zone'.
    I will add that in the planet_type planet database is 2 and in the code is also 2.
    Can anyone help me?
    Please priv. :)
    Images
    • screencapture-xnova-24-pl-uni1-game-php-1494956906229.png

      728.56 kB, 1,366×829, viewed 491 times
    • screencapture-xnova-24-pl-uni1-game-php-1494956944309.png

      695.87 kB, 1,366×829, viewed 572 times
    • screencapture-xnova-24-pl-uni1-game-php-1494957015364.png

      785.6 kB, 1,366×925, viewed 631 times