|
$ttax = mysql_fetch_array(mysql_query("select tax from tribes where players tribe =players[tribe]));
}
echo "</pre>"; THIS BIT MAY BE WRONG!!!
$expgain = (rand(5,10) * $enemy[level]);
$texpgain = ($expgain / 100) * ttax;
$creditgain = ($enemy[credits] / 10);
$tcreditgain = $creditgain / 100 * ttax;
print "<b>$stat[user]</b> have gained <b>$expgain</b> EXP and <b>$creditgain</b> cash.<br>";
mysql_query("update players set hp=$stat[hp] where id=$stat[id]");
mysql_query("update players set hp=0 where id=$enemy[id]");
mysql_query("update players set exp=exp+$expgain - $texpgain where id=$stat[id]");
mysql_query("update players set credits=credits+$creditgain - $tcreditgain where id=$stat[id]");
mysql_query("update tribes set exp=exp+$texpgain where id=$stat[id]");
mysql_query("update tribes set credits=credits+$tcreditgain where id=$stat[id]");
mysql_query("update players set wins=wins+1 where id=$stat[id]");
mysql_query("update players set losses=losses+1 where id=$enemy[id]");
mysql_query("update players set lastkilled='$enemy[user]' where id=$stat[id]");
mysql_query("update players set lastkilledby='$stat[user]' where id=$enemy[id]");
$texp = ($stat[exp] + $expgain);
$expn = (($stat[level] * 50) + ($stat[level] * 15));
if ($texp >= $expn) {
|