Jump to content
MakeWebGames

adjusting "left in the streets" Hospital time


charliemanson
 Share

Recommended Posts

I need some help....want to make times longer....cant figure out........

<?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']} ";

$qe=$r['level']*$r['level']*$r['level'];

$expgain=rand($qe/2,$qe);

$expperc=(int) ($expgain/$ir['exp_needed']*100);

print "and gained $expperc% EXP!

You hide your weapons and drop {$r['username']} off outside the hospital entrance. Feeling satisfied, you walk home.";

$hosptime=rand(40,120);

$db->query("UPDATE users SET exp=exp+$expgain WHERE userid=$userid");

$db->query("UPDATE users SET hp=1,hospital=$hosptime,hospreason='Left by <a href=\'viewuser.php?u={$userid}\'>{$ir['username']}</a>' WHERE userid={$r['userid']}");

event_add($r['userid'],"{$ir['username']} attacked you and left you lying outside the hospital.",$c,'combat');

$atklog=mysql_escape_string($_SESSION['attacklog']);

$db->query("INSERT INTO attacklogs VALUES('',$userid,{$_GET['ID']},'won',unix_timestamp(),-2,'$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-1 WHERE gangID={$r['gang']}");

$ga['gangRESPECT']-=1;

$db->query("UPDATE gangs SET gangRESPECT=gangRESPECT+1 WHERE gangID={$ir['gang']}");

print "

You earnt 1 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']}");

}

$npcs=array(

);

 

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();

?>

 

anything i can adjust? :mrgreen:

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.

 Share

×
×
  • Create New...