Hello.
How to make it work for all uni and I have 5?
It only works for 1 uni.
Display All
How to make it work for all uni and I have 5?
It only works for 1 uni.
PHP Source Code
- //BEGIN ASTEROID EVENT
- if($CONF['asteroid_event'] < TIMESTAMP){
- $GLOBALS['DATABASE']->query("DELETE FROM ".PLANETS." where `id_owner` = '".Asteroid_Id."' AND `id` != '706' ;");
- $galaxy = $this->randRange(1,5,5);
- $system = $this->randRange(1,200,70);
- foreach($system as $System_Element){
- $planets = rand(1,15);
- $cautare = $GLOBALS['DATABASE']->query("SELECT *FROM ".PLANETS." where `galaxy` = '".$Element."' and `system` = '".$System_Element."' and `planet` = '".$planets."' AND `universe` = '".$UNI."';");
- if($GLOBALS['DATABASE']->numRows($cautare)==0){
- $metal_rand = Config::get('asteroid_metal');
- $crystal_rand = Config::get('asteroid_crystal');
- $deuterium_rand= Config::get('asteroid_deuterium');
- $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`)
- VALUES('Asteroid','".Asteroid_Id."','".$UNI."','".$Element."','".$System_Element."','".$planets."','1','asteroid','9800','".$metal_rand."','".$crystal_rand."','".$deuterium_rand."','".TIMESTAMP."');");
- }
- }
- $totalPremiums = $GLOBALS['DATABASE']->query("SELECT DISTINCT `id`, `lang` FROM ".USERS.";");
- $langObjects = array();
- while($xy = $GLOBALS['DATABASE']->fetch_array($totalPremiums)){
- if(!isset($langObjects[$xy['lang']]))
- {
- $langObjects[$xy['lang']] = new Language($xy['lang']);
- $langObjects[$xy['lang']]->includeData(array('L18N', 'INGAME', 'TECH', 'CUSTOM'));
- }
- $LNG = $langObjects[$xy['lang']];
- $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>';
- SendSimpleMessage($xy['id'], 0, TIMESTAMP, 7, $LNG['sys_asteroid_1'], $LNG['sys_asteroid_2'], $message);
- }
- $newevkaka = $CONF['asteroid_event'] + 60*60*24;
- $GLOBALS['DATABASE']->query("UPDATE ".CONFIG." SET asteroid_event = '".$newevkaka."' where `uni` = '".$UNI."';");
- }
- //END ASTEROID EVENT
- //BEGIN FORTRESS EVENT
- if($CONF['fortress_event'] < (TIMESTAMP - 86400)){
- $GLOBALS['DATABASE']->query("DELETE FROM ".PLANETS." where `planet_type` = '4' AND `id` != '706' ;");
- $galaxy = $this->randRange(1,5,5);
- foreach($galaxy as $Element){
- $system = $this->randRange(1,200,70);
- foreach($system as $System_Element){
- $planets = rand(1,15);
- $timerforall = TIMESTAMP + 4*60*60*6;
- $cautare = $GLOBALS['DATABASE']->query("SELECT *FROM ".PLANETS." where `galaxy` = '".$Element."' and `system` = '".$System_Element."' and `planet` = '".$planets."' AND `universe` = '".$UNI."';");
- if($GLOBALS['DATABASE']->numRows($cautare)==0){
- $metal_rand = Config::get('asteroid_metal');
- $crystal_rand = Config::get('asteroid_crystal');
- $deuterium_rand= Config::get('asteroid_deuterium');
- $max_field= mt_rand(69,176);
- $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`)
- VALUES('Fortress Planet','".Fortress_Id."','".$UNI."','".$Element."','".$System_Element."','".$planets."','4','fortress','9800','0','".$max_field."','".$metal_rand."','".$crystal_rand."','".$deuterium_rand."','".TIMESTAMP."','".$timerforall."');");
- }
- }
- }
- $totalPremiums = $GLOBALS['DATABASE']->query("SELECT DISTINCT `id` FROM ".USERS.";");
- while($xy = $GLOBALS['DATABASE']->fetch_array($totalPremiums)){
- $message = "<span class='admin'>Fortress Event started<br>
- Capture your fortress and take advantage of the profits they offer you !<br><br>
- Evenement Fortress a commencer<br>
- Capturez votre forteresse et profiter des multiple avantage qu\'elles peuvent vous offrir !
- </span>";
- SendSimpleMessage($xy['id'], 1, TIMESTAMP, 50, "Event System", "Event Info", $message);
- }
- $newevkaka = $timerforall + 84200;
- $GLOBALS['DATABASE']->query("UPDATE ".CONFIG." SET fortress_event = '".$newevkaka."' where `uni` = '".$UNI."';");
- }
- //END FORTRESS EVENT