Jump to content

Recommended Posts

  • Replies 82
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

GOD VS. CatNCobra
User Start HP:100
Enemy Start HP:100attack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100
Enemy HP:100CatNCobra has done 1890 damage against GODattack
User HP:100
Enemy HP:100GOD has done 268 damage against CatNCobraattack
User HP:100

 

OK, this shows up, i think dmg isnt fixed? im confused now, lol

OK, last one (i hope)

this is less stress on the server and should display clearly

 

else
{
echo' Welcome to the Battle Arena.';

echo "User Start HP:".$user->hp;
echo "<br>Enemy Start HP:".$enemy->hp;
$attacker = ($user->agility > $enemy->agility);

while ($user->hp > 0 && $enemy->hp > 0)
{
	echo "User  HP:".$user->hp;
	echo "<br>Enemy HP:".$enemy->hp;

	if($attacker)
	{
		$dmg = (int)($user->attack - $enemy->defense);
		$enemy->hp = (int)($enemy->hp - dmg);
		echo $user->display_name."  has done $dmg damage against ".$enemy->display_name."<br>"; 
	}else{
		$dmg = (int)($enemy->attack - $user->defense);
		$user->hp = (int)($user->hp - dmg);
		echo $enemy->display_name." has done $dmg damage against ".$user->display_name."<br>";		
	}
	$attacker = !$attacker;
	flush(); //add
}
if( $user->hp == 0)
{
	echo $enemy->display_name." Wins";
}else{
	echo $user->display_name." Wins";	
}
mysql_query("UPDATE `users` SET hp =({$enemy->hp}) WHERE ID = $enemy->ID");
mysql_query("UPDATE `users` SET hp =({$user->hp}) WHERE ID = $user->ID");

}
include('inc/footer.php');
?>

hmmm,  problem, (sorry!!!!)

 

u forgot a } i think

 

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

 

Please contact the server administrator, webmaster@donkeygame.1gig.biz and inform them of the time the error occurred, and anything you might have done that may have caused the error.

 

More information about this error may be available in the server error log.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

i dunno where, its a 500 internal again

can't see the problem

 

try full code

<?php
include('inc/header.php');

$eID = $enemy->ID;
$uID = (int)$_GET['ID'];

if ($uID > 0)
{
#if called from header!
$enemysql = @mysql_query("SELECT * FROM users WHERE ID = '$eID'"); 
$enemy = @mysql_fetch_object($enemysql);
$usersql = @mysql_query("SELECT * FROM users WHERE ID = '$uID'"); 
$user = @mysql_fetch_object($usersql);

echo "$user->display_name"; echo ' VS. ';echo "$enemy->display_name<br>";
}else{
die("error");
}
if ($enemy->ID == $user->ID)
{
echo' You cant attack yourself!';
}
elseif ($user->hp <= 0)
{
echo ' You are in NO condition to do battle';
}
elseif ($enemy->hp == 0)
{
echo ' Your Enemy Is Already Dead!';
}
elseif ($user->energy <= 4)
{
echo ' Not enough energy!';
}
elseif ($user->attack < $enemy->defense)
{
echo ' You look at your opponent, and wet your pants at his/her strength.  You lose the battle.<br><br><br><br><br><br><br><br><br>';
mysql_query("UPDATE `users` SET hp = 0 WHERE ID = '$user->ID'");
}
elseif ($user->defense > $enemy->attack)
{
echo' Your opponent takes one look at you, and dies in fear<br><br><br><br><br><br><br><br><br>';
mysql_query("UPDATE `users` SET hp = 0 WHERE ID = '$enemy->ID'");
}
else
{
echo' Welcome to the Battle Arena.';

echo "User Start HP:".$user->hp;
echo "<br>Enemy Start HP:".$enemy->hp;
$attacker = ($user->agility > $enemy->agility);

while ($user->hp > 0 && $enemy->hp > 0)
{
	echo "User  HP:".$user->hp;
	echo "<br>Enemy HP:".$enemy->hp;

	if($attacker)
	{
		$dmg = (int)($user->attack - $enemy->defense);
		$enemy->hp = (int)($enemy->hp - dmg);
		echo $user->display_name."  has done $dmg damage against ".$enemy->display_name."<br>"; 
	}else{
		$dmg = (int)($enemy->attack - $user->defense);
		$user->hp = (int)($user->hp - dmg);
		echo $enemy->display_name." has done $dmg damage against ".$user->display_name."<br>";		
	}
	$attacker = !$attacker;
	flush(); //add
}
if( $user->hp == 0)
{
	echo $enemy->display_name." Wins";
}else{
	echo $user->display_name." Wins";	
}
mysql_query("UPDATE `users` SET hp =({$enemy->hp}) WHERE ID = $enemy->ID");
mysql_query("UPDATE `users` SET hp =({$user->hp}) WHERE ID = $user->ID");

}
include('inc/footer.php');
?>

 

total guess but i think i cant set the object so i revised it..

<?php
include('inc/header.php');

$eID = $enemy->ID;
$uID = (int)$_GET['ID'];

if ($uID > 0)
{
#if called from header!
$enemysql = @mysql_query("SELECT * FROM users WHERE ID = '$eID'"); 
$enemy = @mysql_fetch_object($enemysql);
$usersql = @mysql_query("SELECT * FROM users WHERE ID = '$uID'"); 
$user = @mysql_fetch_object($usersql);

echo "$user->display_name"; echo ' VS. ';echo "$enemy->display_name<br>";
}else{
die("error");
}
if ($enemy->ID == $user->ID)
{
echo' You cant attack yourself!';
}
elseif ($user->hp <= 0)
{
echo ' You are in NO condition to do battle';
}
elseif ($enemy->hp == 0)
{
echo ' Your Enemy Is Already Dead!';
}
elseif ($user->energy <= 4)
{
echo ' Not enough energy!';
}
elseif ($user->attack < $enemy->defense)
{
echo ' You look at your opponent, and wet your pants at his/her strength.  You lose the battle.<br><br><br><br><br><br><br><br><br>';
mysql_query("UPDATE `users` SET hp = 0 WHERE ID = '$user->ID'");
}
elseif ($user->defense > $enemy->attack)
{
echo' Your opponent takes one look at you, and dies in fear<br><br><br><br><br><br><br><br><br>';
mysql_query("UPDATE `users` SET hp = 0 WHERE ID = '$enemy->ID'");
}
else
{
echo' Welcome to the Battle Arena.';

echo "User Start HP:".$user->hp;
echo "<br>Enemy Start HP:".$enemy->hp;
$attacker = ($user->agility > $enemy->agility);

$uHP = $user->hp;
$eHP = $enemy->hp;
while ($uHP > 0 && $eHP > 0)
{
	echo "User  HP:".$uHP;
	echo "<br>Enemy HP:".$eHP;

	if($attacker)
	{
		$dmg = (int)($user->attack - $enemy->defense);
		$eHP = (int)($eHP - dmg);
		echo $user->display_name."  has done $dmg damage against ".$enemy->display_name."<br>"; 
	}else{
		$dmg = (int)($enemy->attack - $user->defense);
		$uHP = (int)($uHP - dmg);
		echo $enemy->display_name." has done $dmg damage against ".$user->display_name."<br>";		
	}
	$attacker = !$attacker;
	flush(); //add
}
if( $uHP == 0)
{
	echo $enemy->display_name." Wins";
}else{
	echo $user->display_name." Wins";	
}
mysql_query("UPDATE `users` SET hp =($eHP) WHERE ID = $enemy->ID");
mysql_query("UPDATE `users` SET hp =($uHP) WHERE ID = $user->ID");

}
include('inc/footer.php');
?>

<?php
include('inc/header.php');

$eID = $enemy->ID;
$uID = (int)$_GET['ID'];

if ($uID > 0)
{
#if called from header!
$enemysql = @mysql_query("SELECT * FROM users WHERE ID = '$eID'"); 
$enemy = @mysql_fetch_object($enemysql);
$usersql = @mysql_query("SELECT * FROM users WHERE ID = '$uID'"); 
$user = @mysql_fetch_object($usersql);

echo "$user->display_name"; echo ' VS. ';echo "$enemy->display_name<br>";
}else{
die("error");
}
if ($enemy->ID == $user->ID)
{
echo' You cant attack yourself!';
}
elseif ($user->hp <= 0)
{
echo ' You are in NO condition to do battle';
}
elseif ($enemy->hp == 0)
{
echo ' Your Enemy Is Already Dead!';
}
elseif ($user->energy <= 4)
{
echo ' Not enough energy!';
}
elseif ($user->attack < $enemy->defense)
{
echo ' You look at your opponent, and wet your pants at his/her strength.  You lose the battle.<br><br><br><br><br><br><br><br><br>';
mysql_query("UPDATE `users` SET hp = 0 WHERE ID = '$user->ID'");
}
elseif ($user->defense > $enemy->attack)
{
echo' Your opponent takes one look at you, and dies in fear<br><br><br><br><br><br><br><br><br>';
mysql_query("UPDATE `users` SET hp = 0 WHERE ID = '$enemy->ID'");
}
else
{
echo' Welcome to the Battle Arena.';

echo "User Start HP:".$user->hp;
echo "<br>Enemy Start HP:".$enemy->hp;
$attacker = ($user->agility > $enemy->agility);

$uHP = $user->hp;
$eHP = $enemy->hp;
while ($uHP > 0 && $eHP > 0)
{
	echo "User  HP:".$uHP;
	echo "<br>Enemy HP:".$eHP;

	if($attacker)
	{
		$dmg = (int)($user->attack - $enemy->defense);
		$eHP = (int)($eHP - dmg);
		echo $user->display_name."  has done $dmg damage against ".$enemy->display_name."<br>"; 
	}else{
		$dmg = (int)($enemy->attack - $user->defense);
		$uHP = (int)($uHP - dmg);
		echo $enemy->display_name." has done $dmg damage against ".$user->display_name."<br>";		
	}
	$attacker = !$attacker;
	die("end test"); //***************************<---their
	flush(); //add
}
if( $uHP == 0)
{
	echo $enemy->display_name." Wins";
}else{
	echo $user->display_name." Wins";
}
mysql_query("UPDATE `users` SET hp =({$eHP}) WHERE ID = $enemy->ID");
mysql_query("UPDATE `users` SET hp =({$uHP}) WHERE ID = $user->ID");

}
include('inc/footer.php');
?>

 

UPDATED

GOD VS. CatNCobra

Welcome to the Battle Arena.User Start HP:100

Enemy Start HP:100User HP:100

Enemy HP:100CatNCobra has done 1890 damage against GOD

end test

 

 

 

 

and i changed the hp to bigint(sasa)

.

 

 

and techie, can u please! read this

 

this---->  eID and uID need to be changed, the get[id] gets enemies id :)

can you comment out

#die("end test"); //***************************<---their

 

also make sure the last lines are

	mysql_query("UPDATE `users` SET hp =({$eHP}) WHERE ID = $enemy->ID");
mysql_query("UPDATE `users` SET hp =({$uHP}) WHERE ID = $user->ID");

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

 

Please contact the server administrator, webmaster@donkeygame.1gig.biz and inform them of the time the error occurred, and anything you might have done that may have caused the error.

 

More information about this error may be available in the server error log.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

 

server error

OK well we know its the while...

 

ok i am running out of idea..

edited for null damage

 

<?php
include('inc/header.php');

$eID = $enemy->ID;
$uID = (int)$_GET['ID'];

if ($uID > 0)
{
#if called from header!
$enemysql = @mysql_query("SELECT * FROM users WHERE ID = '$eID'"); 
$enemy = @mysql_fetch_object($enemysql);
$usersql = @mysql_query("SELECT * FROM users WHERE ID = '$uID'"); 
$user = @mysql_fetch_object($usersql);

echo "$user->display_name"; echo ' VS. ';echo "$enemy->display_name<br>";
}else{
die("error");
}
if ($enemy->ID == $user->ID)
{
echo' You cant attack yourself!';
}
elseif ($user->hp <= 0)
{
echo ' You are in NO condition to do battle';
}
elseif ($enemy->hp == 0)
{
echo ' Your Enemy Is Already Dead!';
}
elseif ($user->energy <= 4)
{
echo ' Not enough energy!';
}
elseif ($user->attack < $enemy->defense)
{
echo ' You look at your opponent, and wet your pants at his/her strength.  You lose the battle.<br><br><br><br><br><br><br><br><br>';
mysql_query("UPDATE `users` SET hp = 0 WHERE ID = '$user->ID'");
}
elseif ($user->defense > $enemy->attack)
{
echo' Your opponent takes one look at you, and dies in fear<br><br><br><br><br><br><br><br><br>';
mysql_query("UPDATE `users` SET hp = 0 WHERE ID = '$enemy->ID'");
}
else
{
echo' Welcome to the Battle Arena.';

echo "User Start HP:".$user->hp;
echo "<br>Enemy Start HP:".$enemy->hp;
$attacker = ($user->agility > $enemy->agility);

$uHP = $user->hp;
$eHP = $enemy->hp;

//temp values
$edmg = 1;
$udmg = 1;
while ( $uHP > 0 && $eHP > 0 && ($edmg > 0 || $udmg > 0) )
{
	echo "User  HP:".$uHP;
	echo "<br>Enemy HP:".$eHP;
	$edmg = 0;
	$udmg = 0;

	if($attacker)
	{
		$edmg = (int)($user->attack - $enemy->defense);
		$eHP = (int)($eHP - edmg);
		echo $user->display_name."  has done $edmg damage against ".$enemy->display_name."<br>"; 
	}else{
		$udmg = (int)($enemy->attack - $user->defense);
		$uHP = (int)($uHP - udmg);
		echo $enemy->display_name." has done $udmg damage against ".$user->display_name."<br>";		
	}
	$attacker = !$attacker;
	flush(); //add
}
if( $uHP == 0)
{
	echo $enemy->display_name." Wins";
}else{
	echo $user->display_name." Wins";
}
mysql_query("UPDATE `users` SET hp =($eHP) WHERE ID = $enemy->ID");
mysql_query("UPDATE `users` SET hp =($uHP) WHERE ID = $user->ID");

}
include('inc/footer.php');
?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.