thedestroyer Posted November 2, 2009 Share Posted November 2, 2009 Hi can someone tell me how to add into attacklost so the user who loses gets put in hospital? and can you show me where abouts to put it? thanks Quote Link to comment Share on other sites More sharing options...
gambino Posted November 3, 2009 Share Posted November 3, 2009 if you can tell me what scripts your using, then I can tell you. I know for a fact in attacklost.php on v2, people who are left gets no health and I'm not sure about getting put in the hospital. I think I Have to make a script for it. just a little FYI for people who are wandering, I got some V2 mods I have created that are for sale. Quote Link to comment Share on other sites More sharing options...
thedestroyer Posted November 3, 2009 Author Share Posted November 3, 2009 attacklost.php heres 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); $db->query("UPDATE users SET attacks_lost=attacks_lost+1 WHERE userid=$userid"); $db->query("UPDATE users SET attacks_total=attacks_total+1 WHERE userid=$userid"); $db->query("UPDATE users SET defends_won=defends_won+1 WHERE userid={$_GET['ID']}"); $db->query("UPDATE users SET defends_total=defends_total+1 WHERE userid={$_GET['ID']}"); $db->query("UPDATE users SET total_lost=total_lost+1 WHERE userid=$userid"); $db->query("UPDATE users SET total_won=total_won+1 WHERE userid={$_GET['ID']}"); $db->query("UPDATE users SET total_total=total_total+1 WHERE userid=$userid"); $db->query("UPDATE users SET total_total=total_total+1 WHERE userid={$_GET['ID']}"); print "You lost to {$r['username']}"; $expgain=abs(($ir['level']-$r['level'])^3); $expgainp=$expgain/$ir['exp_needed']*100; $hosptime=rand(10,30); 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'],"[url='viewuser.php?u=$userid']{$ir['username']}[/url] attacked you and lost.",$c); $db->query("UPDATE users SET lost={$_GET['ID']} WHERE userid=$userid"); $db->query("UPDATE users SET won=$userid WHERE userid={$_GET['ID']}"); $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 Link to comment Share on other sites More sharing options...
Kasabian Posted November 3, 2009 Share Posted November 3, 2009 This is the query from the attackbeat.php, which will put the attack in hospital once they have lost. Change the $hosptime variable too the min and max time you want that player to be in hospital: $hosptime=rand(15,30); $db->query("UPDATE users SET hp=1, hospital=$hosptime, hospreason='Lost To <a href=\'viewuser.php?u={$r['userid']}\'>{$r['username']}</a>' WHERE userid={$userid}"); Just put that code before the "print "You lost to {$r['username']}";" line. Hope this helps Quote Link to comment Share on other sites More sharing options...
thedestroyer Posted November 3, 2009 Author Share Posted November 3, 2009 $hosptime=rand(15,30); $db->query("UPDATE users SET hp=1, hospital=$hosptime, hospreason='Lost To <a href=\'viewuser.php?u={$r['userid']}\'>{$r['username']}</a>' WHERE userid={$userid}"); that worked thanks a bunch! Quote Link to comment Share on other sites More sharing options...
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.