kenja Posted July 20, 2009 Posted July 20, 2009 How can i change it so when someone loses a fight they don't lose exp? Quote
Cronus Posted July 21, 2009 Posted July 21, 2009 Re: Attack lost Help Most likely you can simply browse over the script and find where it updates the users table, and the exp field. If you don't want them to lose exp, just remove that, or just make it exp=exp+0 Quote
kenja Posted July 21, 2009 Author Posted July 21, 2009 Re: Attack lost Help this is my attacklost.php <?php $atkpage=1; include "globals.php"; $_GET['ID']==abs((int) $_GET['ID']); $_SESSION['attacking']=0; $_SESSION['attacklost']=0; $od=$db->query("SELECT * FROM users WHERE userid={$_GET['ID']}"); if($db->num_rows($od)) { $r=$db->fetch_row($od); print "You lost to {$r['username']}"; $expgain=abs(($ir['level']-$r['level'])^3); $expgainp=$expgain/$ir['exp_needed']*100; print " and lost $expgainp% EXP!"; $db->query("UPDATE users SET exp=exp-$expgain, attacking=0 WHERE userid=$userid"); $db->query("UPDATE users SET exp=0 WHERE exp<0"); event_add($r['userid'],"{$ir['username']} attacked you and lost.",$c); $atklog=mysql_escape_string($_SESSION['attacklog']); $db->query("INSERT INTO attacklogs VALUES('',$userid,{$_GET['ID']},'lost',unix_timestamp(),0,'$atklog');"); $warq=$db->query("SELECT * FROM gangwars WHERE (warDECLARER={$ir['gang']} AND warDECLARED={$r['gang']}) OR (warDECLARED={$ir['gang']} AND warDECLARER={$r['gang']})"); if ($db->num_rows($warq) > 0) { $war=$db->fetch_row($warq); $db->query("UPDATE gangs SET gangRESPECT=gangRESPECT+1 WHERE gangID={$r['gang']}"); $db->query("UPDATE gangs SET gangRESPECT=gangRESPECT-1 WHERE gangID={$ir['gang']}"); print " You lost 1 respect for your gang!"; } } else { print "You lost to Mr. Non-existant! =O"; } $h->endpage(); ?> Quote
CrazyT Posted July 21, 2009 Posted July 21, 2009 Re: Attack lost Help if($dosessh && (isset($_SESSION['attacking']) || $ir['attacking'])) { $db->query('UPDATE `users` SET `attacking` = 0 WHERE `userid` = '. $ir['userid']); $_SESSION['attacking'] = 0; } You should see something simular like that in header.... remove it :D Quote
kenja Posted July 21, 2009 Author Posted July 21, 2009 Re: Attack lost Help thanks CrazyT and Cronus +1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.