Ejemplo n.º 1
0
             $i = 0;
             while (!$res->EOF) {
                 $sectors[$i] = $res->fields['sector_id'];
                 $i++;
                 $res->MoveNext();
             }
             $resx = $db->Execute("UPDATE {$db->prefix}planets SET corp=0 WHERE owner=?;", array($playerinfo['ship_id']));
             db_op_result($db, $resx, __LINE__, __FILE__, $db_logging);
             if (!empty($sectors)) {
                 foreach ($sectors as $sector) {
                     calc_ownership($sector);
                 }
             }
             echo "{$l_team_youveleft} <strong>{$team['team_name']}</strong>.<br><br>";
             defence_vs_defence($db, $playerinfo['ship_id']);
             kick_off_planet($db, $playerinfo['ship_id'], $whichteam);
             playerlog($db, $playerinfo['ship_id'], LOG_TEAM_LEAVE, $team['team_name']);
             playerlog($db, $team['creator'], LOG_TEAM_NOT_LEAVE, $playerinfo['character_name']);
         }
     }
 } elseif ($confirmleave == 2) {
     // owner of a team is leaving and set a new owner
     $res = $db->Execute("SELECT character_name FROM {$db->prefix}ships WHERE ship_id=?;", array($newcreator));
     db_op_result($db, $res, __LINE__, __FILE__, $db_logging);
     $newcreatorname = $res->fields;
     echo "{$l_team_youveleft} <strong>{$team['team_name']}</strong> {$l_team_relto} {$newcreatorname['character_name']}.<br><br>";
     $resx = $db->Execute("UPDATE {$db->prefix}ships SET team='0' WHERE ship_id=?;", array($playerinfo['ship_id']));
     db_op_result($db, $resx, __LINE__, __FILE__, $db_logging);
     $resy = $db->Execute("UPDATE {$db->prefix}ships SET team=? WHERE team=?;", array($newcreator, $creator));
     db_op_result($db, $resy, __LINE__, __FILE__, $db_logging);
     $resz = $db->Execute("UPDATE {$db->prefix}teams SET number_of_members = number_of_members - 1, creator=? WHERE id=?;", array($newcreator, $whichteam));
Ejemplo n.º 2
0
            $i++;
            $res->MoveNext();
          }

          $db->Execute("UPDATE $dbtables[planets] SET corp=0 WHERE owner=$playerinfo[player_id]");
          if(!empty($sectors))
          {
            foreach($sectors as $sector)
            {
              calc_ownership($sector);
            }
          }

					echo "$l_team_youveleft <B>$team[team_name]</B>.<BR><BR>";
          defence_vs_defence($playerinfo[player_id]);
          kick_off_planet($playerinfo[player_id],$whichteam);
  				playerlog($playerinfo[player_id], LOG_TEAM_LEAVE, decodeHTML($team[team_name]));
  				playerlog($team[creator], LOG_TEAM_NOT_LEAVE, "$playerinfo[character_name]");
				}
			}
		} elseif ($confirmleave == 2) { // owner of a team is leaving and set a new owner
			$res = $db->Execute("SELECT character_name FROM $dbtables[players] WHERE player_id=$newcreator");
			$newcreatorname = $res->fields;
			echo "$l_team_youveleft <B>$team[team_name]</B> $l_team_relto $newcreatorname[character_name].<BR><BR>";
			$db->Execute("UPDATE $dbtables[players] SET team='0' WHERE player_id='$playerinfo[player_id]'");
			$db->Execute("UPDATE $dbtables[players] SET team=$newcreator WHERE team=$creator");
			$db->Execute("UPDATE $dbtables[teams] SET number_of_members=number_of_members-1,creator=$newcreator WHERE id=$whichteam");

      $res = $db->Execute("SELECT DISTINCT sector_id FROM $dbtables[planets] WHERE owner=$playerinfo[player_id] AND base='Y' AND corp!=0");
      $i=0;
      while(!$res->EOF)