Beste leden,
Als je bij ons spel iemand aanvalt die bijv. 9 miljard contant hebt staan, kom je zelf in de min te staan als je hebt gewonnen. Weet iemand hoe dit komt? Wij snappen het niet.
Hier de attack.php:
PHP
<?php /* ------------------------- */
include("_include-config.php");
if(! check_login()) {
header("Location: login.php");
exit;
}
$pagename = "Attack";
include("counter.inc.php");
mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
if ($data->leven == 1){
print <<<ENDHTML
<html>
<head>
<META HTTP-EQUIV="Page-Enter" content="blendTrans(Duration=0.5)">
<title>War of the Future</title>
<link rel="stylesheet" type="text/css" href="css.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
</style></head>
<table width=100%>
<tr><td class="subTitle"><b>Sorry</b></td></tr>
<tr><td class="mainTxt">
<center>Je bent geraakt, ga naar het ziekenhuis om je te laten behandelen!
</center>
</td></tr>
</table>
</body>
</html>
ENDHTML;
exit;
}
if($def->vermoord >10)
{
print <<<ENDHTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base target="mainFrame" />
<link rel="stylesheet" type="text/css" href="css-v1.css">
</head>
<table align="center" width=100%>
<tr><td class="subTitle"><b>ZiekenHuis</b></td></tr>
<tr><td class="mainTxt">
<center>
<center><b>Je zit in het ziekenhuis</b><br><br>
<b>Geen energie had je meer over! dus ben je met spoed naar het dichtbij zijnde ziekenhuis gebracht!
Je moet ff wat energie weer kopem om ontslagen uit het ziekenhuis te worden!</b>
</td></tr>
</table>
<table align="center" width=100%>
<tr><td class="subTitle"><b>Niks te doen? Speel dan een Spelletje!</b></td></tr>
<tr><td class="mainTxt">
<Input type="radio" value="xw" name="spel1" onClick="window.location=('games/neave_asteroids.php')"> Asteroids<br>
<Input type="radio" value="xw" name="spel2" onClick="window.location=('games/neave_hexxagon.php')"> Hexxagon<br>
<Input type="radio" value="xw" name="spel3" onClick="window.location=('games/neave_simon.php')"> Simon<br>
<Input type="radio" value="xw" name="spel4" onClick="window.location=('games/neave_snake.php')"> Snake<br>
<Input type="radio" value="xw" name="spel5" onClick="window.location=('games/neave_tetris.php')"> Tetris
</td></tr></table>
</body>
</html>
ENDHTML;
exit;
}
/* ------------------------- */ ?>
<html>
<head>
<title>Wotf.nl</title>
<link rel="stylesheet" type="text/css" href="<?php echo ($_COOKIE['v'] == 2) ? "css-v2.css" : "css-v1.css"; ?>">
</head>
<table width=100%>
<tr><td class="subTitle"><b><img src=/icons/bomb.png border= 0> Attack <img src=/icons/bomb.png border= 0></b></td></tr>
<?php /* ------------------------- */
if(round($data->signup/3600-time()/3600) + 12 <= 0) {
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`attlosses`,`attwins`,`deflosses`,`defwins`,`cash`,`type`,`clan` FROM `[users]` WHERE `login`='{$_GET['x']}' AND `activated`=1");
$land = Array("","Amsterdam","Almere","Utrecht","Hilversum","Assen","Tilburg","Rotterdam","Delft","Haarlem","Beverwijk","Venlo","Arnhem","Zwolle","Eindhoven");
$land = $land[$data->land];
if($def = mysql_fetch_object($dbres)) {
if($def->login == $data->login)
print " <tr><td class="mainTxt">Je kan jezelf niet aanvallen!</td></tr>n";
else if($def->type == 3 && $data->type == 3)
print " <tr><td class="mainTxt">Agenten mogen elkaar niet aanvallen</td></tr>n";
else if($def->clan == $data->clan && $def->clan != "")
print " <tr><td class="mainTxt">Je zit in dezelfde squad als deze persoon. Dan kan je hem niet aanvallen</td></tr>n";
else if($def->payprotection > 0 )
print " <tr><td class="mainTxt">{$def->login} heeft bescherming gekocht. </td></tr>n";
else if(round($def->signup/3600-time()/3600) + 12 > 0)
print " <tr><td class="mainTxt">{$def->login} staat nog onder bescherming. </td></tr>n";
else if ($data->vermoord == 0 && $def->vermoord == 24)
print " <tr><td class="mainTxt">{$def->login} staat nog onder bescherming. </td></tr>n";
else {
$dbres = mysql_query("SELECT * FROM `[logs]` WHERE `login`='{$data->login}' AND `person`='{$def->login}' AND FLOOR(UNIX_TIMESTAMP(`time`)/(60*60*24))=FLOOR(UNIX_TIMESTAMP(NOW())/(60*60*24)) AND `area`='attack'");
if(($numattacks = mysql_num_rows($dbres)+1) <= 300) {
$dbres = mysql_query("SELECT * FROM `[logs]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`time`) < 10 AND `login`='{$data->login}' AND `area`='attack'");
if(mysql_num_rows($dbres) == 0) {
mysql_query("SELECT GET_LOCK('attack_{$def->login}',5)");
$result = (($data->attack+$data->clicks*5)*rand(90,115) >= ($def->defence+$def->clicks*5)*rand(90,115)) ? 1 : 0;
$money = ($result == 1) ? (int)($def->cash*rand(40,75)/100) : (int)($data->cash*rand(25,40)/100);
$text = ($result == 1) ? Array("je hebt gewonnen!","gewonnen") : Array("je verliest.","verloren");
$forwardedFor = ($_SERVER['HTTP_X_FORWARDED_FOR'] != "") ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['HTTP_CLIENT_IP'];
$forwardedFor = preg_replace('/, .+/','',$forwardedFor);
mysql_query("INSERT INTO `[logs]`(`time`,`IP`,`forwardedFor`,`login`,`person`,`code`,`area`) values(NOW(),'{$_SERVER['REMOTE_ADDR']}','$forwardedFor','{$data->login}','{$def->login}',($money << 1) | $result,'attack')");
if($result == 1) {
mysql_query("UPDATE `[users]` SET `cash`=". ($def->cash-$money) .",`deflosses`=". ($def->deflosses+1) .",`leven`=`leven`-2 WHERE `login`='{$def->login}'");
$data->cash += $money;
$data->attwins++;
mysql_query("UPDATE `[users]` SET `cash`={$data->cash},`attwins`={$data->attwins} WHERE `login`='{$data->login}'");
}
else {
$data->cash -= $money;
$data->attlosses++;
mysql_query("UPDATE `[users]` SET `cash`={$data->cash},`attlosses`={$data->attlosses},`leven`=`leven`-2 WHERE `login`='{$data->login}'");
mysql_query("UPDATE `[users]` SET `cash`=". ($def->cash+$money) .",`defwins`=". ($def->defwins+1) ." WHERE `login`='{$def->login}'");
}
print " <table width=100% align=center>n";
print " <td class=subTitle width=60><b>{$data->login}</b></td>n";
print " <td class=mainTxt width=5%><center></center></td>n";
print " <center><td class=subTitle width=60><b>{$def->login}</b></td> </tr> <tr></center>n";
print " </tr>n";
print " </table>n";
print " <table width=60% align=center><td class=mainTxt><b><img src=/icons/bomb.png border= 0> Je valt {$def->login} aan en {$text[0]}<br>Je hebt €$money {$text[1]}!<center></td></tr></table>n";
mysql_query("SELECT RELEASE_LOCK('attack_{$def->login}')");
}
else {
$type = Array("","soldaten","oorlogsmisdadigers","wapenhandelaren");
$type = $type[$data->type];
print " <tr><td class="mainTxt">Je $type zijn nog moe van de vorige aanval, over een paar secondes kan je weer aanvallen</td></tr>n";
}
}
else
print " <tr><td class="mainTxt">Je hebt {$def->login} al 5x aangevallen vandaag, zoek iemand anders om aan te vallen</td></tr>n";
}
}
}
else
print " <tr><td class="mainTxt">Je kunt niemand aanvallen wanneer je onder bescherming staat, ga naar je thuisbasisr om je bescherming weg te halen!</td></tr>n";
/* ------------------------- */ ?>
</table>
</body>
</html>
<? mysql_close(); ?>
Toon Meer