Okay yall gonna laugh at me but Im trying... I try to add where my users have to have a certain amount of stats before they can get exp. points to prevent people from getting super high levels wit no stats.
I get an error that I have an unexpected else.
Any way this is what I did this what was there.
if($odata['hp'] <= 0)
{
$odata['hp']=0;
$_SESSION['attackwon']=$_GET['ID'];
$db->query("UPDATE users SET hp=0 WHERE userid={$_GET['ID']}");
print "<br />
<b>What do you want to do with {$odata['username']} now?</b><br /><br />
<form action='attackwon.php?ID={$_GET['ID']}' method='post'><input type='submit' STYLE='color: white; background-color: red;' value='Mug Them' /> </form> <br />
<form action='attackbeat.php?ID={$_GET['ID']}' method='post'><input type='submit' STYLE='color: white; background-color: green;' value='Hospitalize Them' /> </form> <br />
<form action='attacktake.php?ID={$_GET['ID']}' method='post'><input type='submit' STYLE='color: black; background-color: white;' value='Leave Them' /> </form> <br />
<br />
NB:If you not choose any of the option above you lose all your EXP point ! <br /> <br />
If you and the enemy beaten are on the same battle ladder mug them to get points added to the ladder table !
";right after that I added
}
else if ($odata['hp'] <= 0 and ($youdata['strength']+$youdata['guard']+$youdata['agility']) < ($youdata['level']*60000));
{
$odata['hp']=0;
$_SESSION['attackwon']=$_GET['ID'];
$db->query("UPDATE users SET hp=0 WHERE userid={$_GET['ID']}");
print "<br />
<b>What do you want to do with {$odata['username']} now?</b><br /><br />
<form action='attackwon.php?ID={$_GET['ID']}' method='post'><input type='submit' STYLE='color: white; background-color: red;' value='Mug Them' /> </form> <br />
<form action='attackbeat.php?ID={$_GET['ID']}' method='post'><input type='submit' STYLE='color: white; background-color: green;' value='Hospitalize Them' /> </form> <br />
<br />
Before you can get anymore exp. you have to work on your stats.
NB:If you not choose any of the option above you lose all your EXP point ! <br /> <br />
If you and the enemy beaten are on the same battle ladder mug them to get points added to the ladder table !
";
}This is the line where the error is I just posted the whole thing. unexpected else
else {
//choose opp gun
$eq=$db->query("SELECT i.* FROM items i WHERE i.itmid IN({$odata['equip_primary']}, {$odata['equip_secondary']})");
if(mysql_num_rows($eq) == 0)
{
$wep="Fists";
$dam=(int)((((int) ($odata['strength']/$ir['guard']/100)) +1)*(rand(8000,12000)/10000));
}
else
{
$cnt=0;
while($r=$db->fetch_row($eq))
{
$enweps[]=$r;
$cnt++;
}
$weptouse=rand(0,$cnt-1);
$wep=$enweps[$weptouse]['itmname'];
$dam=(int) (($enweps[$weptouse]['weapon']*$odata['strength']/($youdata['guard']/1.5))*(rand(8000,12000)/10000));
}
$hitratio=max(10,min(60*$odata['agility']/$ir['agility'],95));
if(rand(1,100) <= $hitratio)
If anyone has better way to do this that would be great also....