Ejemplo n.º 1
0
<?php

include "head.php";
include "navlogged.php";
include "connect.php";
$sid = $_POST["sid"];
if (!isset($sid)) {
    $sid = $_GET["sid"];
}
$schiff = new schiffgeneral();
$schiff->getData($sid);
$accid = $_SESSION["Id"];
if ($job == 1) {
    //Schiff 3 bauen
    if ($schiff->rohstoffa >= 600 && $schiff->rohstoffb >= 250 && $schiff->rohstoffd >= 10) {
        $schiff->rohstoffa -= 600;
        $schiff->rohstoffb -= 250;
        $schiff->rohstoffd -= 10;
        $schiff->setData($schiff->id);
        $schiff->getData($schiff->id);
        $lastid = checkforlastid('schiffe') + 1;
        mysql_query("INSERT INTO schiffe (klasse,skillbase,id,rohstoffa,rohstoffb,deuterium,hull,maxhull,schilde,maxschilde,laser,name,besitzer,alarmstufe,x,y,energie,maxenergie,energieoutput,img,lager,orbit) VALUES ('Raumtation','1','{$lastid}','4','{$fid}','100','2000','2000','1000','1000','50','noname','{$accid}','green','{$schiff->x}','{$schiff->y}','1000','1000','100','images/siedlerbase.png','1500','{$schiff->orbit}')") or die(mysql_error());
        mysql_query("INSERT INTO schiffsmodule (sid,a1,a2,a3,b1,b2) VALUES ('{$lastid}','-1','-1','-1','-1','-1')");
        echo 'Schiff gebaut!';
        $gebaut = true;
    } else {
        echo 'Nicht genug Rohstoffe!';
    }
}
if ($job == 2) {
    //Schiff 3 bauen
Ejemplo n.º 2
0
$tmp = mysql_query("SELECT besitzer FROM schiffe WHERE id='{$testid}'");
while ($testtmp = mysql_fetch_array($tmp)) {
    if ($_SESSION["Id"] != $testtmp["besitzer"]) {
        $betray = true;
    }
}
if ($betray && $testid > 0) {
    echo 'Du bist nicht eingeloggt oder du versucht auf fremde Accounts zuzugreifen...';
} else {
    //CHEATSCHUTZ ENDE
    $fromid = $_GET["from"];
    $toid = $_GET["to"];
    $from = new schiff();
    $from->getData($fromid);
    $to = new schiffgeneral();
    $to->getData($toid);
    //daten geholt ^^^^^
    $do = $_POST["do"];
    if ($from->y != $to->y || $from->x != $to->x) {
        echo '<span style="color:red;">Hinweis: Ziel ist nicht im Sektor! kein Vorgang m&ouml;glich!</span><br />';
        $do = -1;
    }
    if ($to->schildstatus == 1 && $schiff->besitzer != $_SESSION["Id"]) {
        echo '<span style="color:yellow;">Ziel hat Schilde aktiviert! Beamen nicht m&ouml;glich.</span><br />';
        $do = -1;
    }
    if ($do == 1) {
        //beamen!
        //rostoff a
        $amountA = $_POST["ra"];
        //if($amoumtA=="") $amountA=0;