Jump to content
MakeWebGames

[MCCODES V2][HELP] Members spend too long in hospital


Bluedemon909

Recommended Posts

Hey, When people get attack and die, They get sent to the hospital for about 100 minutes. So I'm wandering how can i change this so that the maximum time spent in the hopital will be 15 minutes.

Here's my the code I'm using

<?php
include "globals.php";
print "<h3>Hospital</h3>
<table width='75%' class=\"table\" border=\"0\" cellspacing=\"1\"><tr bgcolor=gray><th>Name</th> <th>Level</th> <th>Time</th><th>Reason</th></tr>";
$q=$db->query("SELECT u.*,c.* FROM users u LEFT JOIN gangs c ON u.gang=c.gangID WHERE u.hospital > 0 ORDER BY u.hospital DESC",$c);
while($r=$db->fetch_row($q))
{
print "\n<tr><td>{$r['gangPREFIX']} [url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]</td><td>
{$r['level']}</td><td>{$r['hospital']} minutes</td><td>{$r['hospreason']}</td></tr>";
}
print "</table>";
$h->endpage();
?>
Link to comment
Share on other sites

The code you showed is the part where you actually have an overview of the people that are already in hospital, not for how long you put them into it.

I believe you'll need to find the attackend.php file and look into that. there should be 3 options - i think - for the player (hosp mug leave) where the system also puts the user into the hospital, reduce that time and your members will spend lesser time in hospital.

Link to comment
Share on other sites

The code you showed is the part where you actually have an overview of the people that are already in hospital, not for how long you put them into it.

I believe you'll need to find the attackend.php file and look into that. there should be 3 options - i think - for the player (hosp mug leave) where the system also puts the user into the hospital, reduce that time and your members will spend lesser time in hospital.

I don't seem to have a attackend.php file so im guessing it might be the attackbeat.php

<?php
$atkpage=1;
include "globals.php";

$_GET['ID']=abs((int) $_GET['ID']);
$_SESSION['attacking']=0;
$ir['attacking']=0;
$db->query("UPDATE users SET attacking=0 WHERE userid=$userid");
$od=$db->query("SELECT * FROM users WHERE userid={$_GET['ID']}");
if($_SESSION['attackwon'] != $_GET['ID'])
{
die ("Cheaters don't get anywhere.");
}
if($db->num_rows($od))
{
$r=$db->fetch_row($od);
$gq=$db->query("SELECT * FROM gangs WHERE gangID={$r['gang']}");
$ga=$db->fetch_row($gq);
if($r['hp'] == 1)
{
print "What a cheater u are.";
}
else
{
print "You beat {$r['username']}!!

You beat {$r['username']} severely on the ground. You are now known all across Hyrule for your heroic deed!.";
$hosptime=rand(50,150)+floor($ir['level']/2);
$db->query("UPDATE users SET hp=1,hospital=$hosptime,hospreason='Hospitalized by <a href=\'viewuser.php?u={$userid}\'>{$ir['username']}</a>' WHERE userid={$r['userid']}");
event_add($r['userid'],"[url='viewuser.php?u=$userid']{$ir['username']}[/url] beat you up.",$c);
$atklog=mysql_escape_string($_SESSION['attacklog']);
$db->query("INSERT INTO attacklogs VALUES('',$userid,{$_GET['ID']},'won',unix_timestamp(),-1,'$atklog');");
$_SESSION['attackwon']=0;
$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-3 WHERE gangID={$r['gang']}");
$ga['gangRESPECT']-=3;
$db->query("UPDATE gangs SET gangRESPECT=gangRESPECT+3 WHERE gangID={$ir['gang']}");
print "
You earnt 3 respect for your gang!";

}
//Gang Kill
if ($ga['gangRESPECT']<=0 && $r['gang'])
{
$db->query("UPDATE users SET gang=0 WHERE gang={$r['gang']}");

$db->query("DELETE FROM gangs WHERE gangRESPECT<='0'");
$db->query("DELETE FROM gangwars WHERE warDECLARER={$ga['gangID']} or warDECLARED={$ga['gangID']}");
}
if($r['user_level']==0)
{
$q=$db->query("SELECT * FROM challengebots WHERE cb_npcid={$r['userid']}");
if ($db->num_rows($q)) {
$cb=$db->fetch_row($q);
$qk=$db->query("SELECT * FROM challengesbeaten WHERE userid=$userid AND npcid={$r['userid']}");
if(!$db->num_rows($qk))
{
$m=$cb['cb_money'];
$db->query("UPDATE users SET money=money+$m WHERE userid=$userid");
print "
You gained \$$m for beating the challenge bot {$r['username']}";
$db->query("INSERT INTO challengesbeaten VALUES($userid, {$r['userid']})");
}
}
}


}
}
else
{
print "You beat Mr. non-existant!";
}

$h->endpage();
?>

That's my code for attackend.php What would i have to change? (sorry im still learning php)

Link to comment
Share on other sites

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.   Paste as plain text instead

  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...