Jump to content
MakeWebGames

Driveby error


HITMAN 17

Recommended Posts

<?php
/*-----------------------------------------------------
-- Blown City
-- A product of GoldenZero.Net
-- Copyright held 2007 by GoldenZero
-- E-mail: joshisthebest1ca[AT]msn[DOT]com
-----------------------------------------------------*/
include "globals.php";
include "mysql.php";
include "driveby_config.php";
global $db_config;

$in = abs((int) $_GET['ID']);
$braveuse=$ir['level']*$bravecost;
$youdata=$ir;
$q=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$_GET['ID']}",$c);
$odata=mysql_fetch_array($q);

if(!$ir['donatordays'])
{
{
die("You must be a donator to do drive bys");
}


$hosp = rand(50,150);
if($odata['bguard'] >0)
{
$er=$db->query("SELECT username FROM users WHERE userid={$_GET['ID']}");
$er=$db->fetch_row($er);
$db->query("UPDATE users SET hp=0, hospital=hospital+$hosp, hospreason='Car Blown Up By {$er['username']}\'s Personal Bodyguard' WHERE userid=$userid");
$btext="Congratulations your bodyguard saved your life from {$r['username']}!!";
$db->query("INSERT INTO events VALUES('',$userid,UNIX_TIMESTAMP(),0,'$btext')");
$db->query("UPDATE users SET new_events=new_events+1 WHERE userid={$userid}");
die("<center>[b]<font color='#FFFF00'>Holy Shit![/b]</font> You Just Got Your Ass Kicked By The Bodygaurd!!

[url='index.php']>Home[/url]</center>");
}

$i=mysql_query("SELECT * FROM inventory WHERE inv_id={$_GET['cID']} AND inv_userid=$userid",$c);
if(mysql_num_rows($i) == 0)
{
die("You do not currently possess a Car");
}
if(!$in)
{
 print "Error - no valid player ID to drive by.";
 $h->endpage();
 exit;
}
$q = mysql_query("SELECT * FROM `users` WHERE userid = {$in}", $c);
if(!mysql_num_rows($q))
{
 print "Error - you can't do a drive by on someone who dosent exist, what are you smoking dude?";
 $h->endpage();
 exit;
}
if ($ir['gang'] == $odata['gang'] && $ir['gang'] > 0)
{
print "You are in the same gang as {$odata['username']}, are you completely retarded?";
$h->endpage();
exit;
}


$r = mysql_fetch_array($q);
if(in_array($in, $db_config['prohibited']))
{
 print "Error - you cannot do a drive by on this player.


 [url='index.php']> Go Back[/url]";
 $h->endpage();
 exit;
}
if($r['user_level'] == 0 && $db_config['nobomb'])
{
 print "Error - you cannot do a drive by on NPCs.


 [url='index.php']> Go Back[/url]";
 $h->endpage();
 exit;
}
if($in == $userid)
{
 print "Error - you cannot do a drive by on yourself!


 [url='index.php']> Go Back[/url]";
 $h->endpage();
 exit;
}
if($r['fedjail'])
{
 print "Error - you cannot do a drive by on people in Federal Jail


 [url='index.php']> Go Back[/url]";
 $h->endpage();
 exit;
}
if($r['hospital'])
{
 print "Error - you cannot drive by people who are in the hospital


 [url='index.php']> Go Back[/url]";
 $h->endpage();
 exit;
}
if($ir['hospital'])
{
 print "Error - you cannot drive by people when you are in the hospital


 [url='index.php']> Go Back[/url]";
 $h->endpage();
 exit;
}
if($r['jail'])
{
 print "Error - you cannot drive by people who are in jail


 [url='index.php']> Go Back[/url]";
 $h->endpage();
 exit;
}
if($ir['jail'])
{
 print "Error - you cannot drive by people when you are in jail


 [url='index.php']> Go Back[/url]";
 $h->endpage();
 exit;
}
if($ir['brave'] < $braveuse)
{
 print "Error - you need $braveuse Bravery to drive by someone.


 [url='index.php']> Go Back[/url]";
 $h->endpage();
 exit;
}

$rsf = rand(1,100);
$exp = rand($db_config['minexp'],$db_config['maxexp']);
if($rsf <= $db_config['chance'])


 {
 mysql_query("UPDATE users SET exp=exp+{$exp}, brave=brave-$braveuse WHERE userid={$userid}", $c);
 $hosp = rand($db_config['minhosp'],$db_config['maxhosp']);
 mysql_query("UPDATE users SET hospital=hospital+{$hosp}, hospreason='Shot by {$ir['username']} during a drive by' WHERE userid={$in}", $c);
 mysql_query("UPDATE inventory SET inv_qty=inv_qty-1 WHERE inv_id={$_GET['ID']}",$c);
 mysql_query("DELETE FROM inventory WHERE inv_qty=0",$c);
 event_add($in, "[url='viewuser.php?u=$userid']{$ir['username']}[/url] shot you in a drive by", $c);
 print "You call up your gang and load up in your car. You drive down to {$r['username']}s hood.
you see them walking down the street...
You hang your gun out the window and blast {$r['username']} a few times </br>sending them to the hospital for $hosp minutes, and earning you $exp EXP!
You and your boys go and ramp the car off a bridge.";
 mysql_query("UPDATE inventory SET inv_qty=inv_qty-1 WHERE inv_id={$_GET['cID']}",$c);
 mysql_query("DELETE FROM inventory WHERE inv_qty=0",$c);
$db->query("INSERT INTO userattacks VALUES($userid,'You drove by <a href=viewuser.php?u={$r['userid']}>{$r['username']}</a> and hospitalized them.',unix_timestamp());");
$db->query("INSERT INTO userattacks VALUES({$r['userid']},'You got drove by from <a href=viewuser.php?u=$userid>{$ir['username']}</a>, and hospitalized you.',unix_timestamp());");

}
else
{
$exp = rand($db_config['minexp'],$db_config['maxexp']);
$hosp = rand($db_config['minhosp'],$db_config['maxhosp']);
 mysql_query("UPDATE users SET brave=brave-$braveuse WHERE userid={$userid}", $c);
 mysql_query("UPDATE users SET hospital=hospital+{$hosp}, hospreason='Wrecked while attempting a drive by.' WHERE userid={$userid}", $c);
 mysql_query("UPDATE users SET exp=exp-{$exp} WHERE userid={$userid}", $c);
 event_add($in, "[url='viewuser.php?u=$userid']{$ir['username']}[/url] attempted to mailbomb you, but the idiot crossed the wires and it exploded in his/her face.", $c);
 print "You call up your gang and load up in your car. You drive down to {$r['username']}s hood.
you see them walking down the street...
Your driver wasnt paying attention and hit a light post and totaled the car 
sending you to the hospital for {$hosp} minutes,
and taking $exp EXP from you.";
 mysql_query("UPDATE inventory SET inv_qty=inv_qty-1 WHERE inv_id={$_GET['cID']}",$c);
 mysql_query("DELETE FROM inventory WHERE inv_qty=0",$c);
$db->query("INSERT INTO userattacks VALUES($userid,'You tried to drive by <a href=viewuser.php?u={$r['userid']}>{$r['username']}</a> and crashed.',unix_timestamp());");
$db->query("INSERT INTO userattacks VALUES({$r['userid']},'<a href=viewuser.php?u=$userid>{$ir['username']}</a> tried to do a drive by, and crashed.',unix_timestamp());");
}
$h->endpage();
?>

error

Parse error: syntax error, unexpected $end in /home/chavster/public_html/driveby.php on line 163
Link to comment
Share on other sites

Re: Driveby error

Try

<?php
/*-----------------------------------------------------
-- Blown City
-- A product of GoldenZero.Net
-- Copyright held 2007 by GoldenZero
-- E-mail: joshisthebest1ca[AT]msn[DOT]com
-----------------------------------------------------*/
include "globals.php";
include "mysql.php";
include "driveby_config.php";
global $db_config;

$in = abs((int) $_GET['ID']);
$braveuse=$ir['level']*$bravecost;
$youdata=$ir;
$q=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$_GET['ID']}",$c);
$odata=mysql_fetch_array($q);

if(!$ir['donatordays'])
{
die("You must be a donator to do drive bys");
}


$hosp = rand(50,150);
if($odata['bguard'] >0)
{
$er=$db->query("SELECT username FROM users WHERE userid={$_GET['ID']}");
$er=$db->fetch_row($er);
$db->query("UPDATE users SET hp=0, hospital=hospital+$hosp, hospreason='Car Blown Up By {$er['username']}\'s Personal Bodyguard' WHERE userid=$userid");
$btext="Congratulations your bodyguard saved your life from {$r['username']}!!";
$db->query("INSERT INTO events VALUES('',$userid,UNIX_TIMESTAMP(),0,'$btext')");
$db->query("UPDATE users SET new_events=new_events+1 WHERE userid={$userid}");
die("<center>[b]<font color='#FFFF00'>Holy Shit![/b]</font> You Just Got Your Ass Kicked By The Bodygaurd!!

[url='index.php']>Home[/url]</center>");
}

$i=mysql_query("SELECT * FROM inventory WHERE inv_id={$_GET['cID']} AND inv_userid=$userid",$c);
if(mysql_num_rows($i) == 0)
{
die("You do not currently possess a Car");
}
if(!$in)
{
 print "Error - no valid player ID to drive by.";
 $h->endpage();
 exit;
}
$q = mysql_query("SELECT * FROM `users` WHERE userid = {$in}", $c);
if(!mysql_num_rows($q))
{
 print "Error - you can't do a drive by on someone who dosent exist, what are you smoking dude?";
 $h->endpage();
 exit;
}
if ($ir['gang'] == $odata['gang'] && $ir['gang'] > 0)
{
print "You are in the same gang as {$odata['username']}, are you completely retarded?";
$h->endpage();
exit;
}


$r = mysql_fetch_array($q);
if(in_array($in, $db_config['prohibited']))
{
 print "Error - you cannot do a drive by on this player.


 [url='index.php']> Go Back[/url]";
 $h->endpage();
 exit;
}
if($r['user_level'] == 0 && $db_config['nobomb'])
{
 print "Error - you cannot do a drive by on NPCs.


 [url='index.php']> Go Back[/url]";
 $h->endpage();
 exit;
}
if($in == $userid)
{
 print "Error - you cannot do a drive by on yourself!


 [url='index.php']> Go Back[/url]";
 $h->endpage();
 exit;
}
if($r['fedjail'])
{
 print "Error - you cannot do a drive by on people in Federal Jail


 [url='index.php']> Go Back[/url]";
 $h->endpage();
 exit;
}
if($r['hospital'])
{
 print "Error - you cannot drive by people who are in the hospital


 [url='index.php']> Go Back[/url]";
 $h->endpage();
 exit;
}
if($ir['hospital'])
{
 print "Error - you cannot drive by people when you are in the hospital


 [url='index.php']> Go Back[/url]";
 $h->endpage();
 exit;
}
if($r['jail'])
{
 print "Error - you cannot drive by people who are in jail


 [url='index.php']> Go Back[/url]";
 $h->endpage();
 exit;
}
if($ir['jail'])
{
 print "Error - you cannot drive by people when you are in jail


 [url='index.php']> Go Back[/url]";
 $h->endpage();
 exit;
}
if($ir['brave'] < $braveuse)
{
 print "Error - you need $braveuse Bravery to drive by someone.


 [url='index.php']> Go Back[/url]";
 $h->endpage();
 exit;
}

$rsf = rand(1,100);
$exp = rand($db_config['minexp'],$db_config['maxexp']);
if($rsf <= $db_config['chance'])


 {
 mysql_query("UPDATE users SET exp=exp+{$exp}, brave=brave-$braveuse WHERE userid={$userid}", $c);
 $hosp = rand($db_config['minhosp'],$db_config['maxhosp']);
 mysql_query("UPDATE users SET hospital=hospital+{$hosp}, hospreason='Shot by {$ir['username']} during a drive by' WHERE userid={$in}", $c);
 mysql_query("UPDATE inventory SET inv_qty=inv_qty-1 WHERE inv_id={$_GET['ID']}",$c);
 mysql_query("DELETE FROM inventory WHERE inv_qty=0",$c);
 event_add($in, "[url='viewuser.php?u=$userid']{$ir['username']}[/url] shot you in a drive by", $c);
 print "You call up your gang and load up in your car. You drive down to {$r['username']}s hood.
you see them walking down the street...
You hang your gun out the window and blast {$r['username']} a few times </br>sending them to the hospital for $hosp minutes, and earning you $exp EXP!
You and your boys go and ramp the car off a bridge.";
 mysql_query("UPDATE inventory SET inv_qty=inv_qty-1 WHERE inv_id={$_GET['cID']}",$c);
 mysql_query("DELETE FROM inventory WHERE inv_qty=0",$c);
$db->query("INSERT INTO userattacks VALUES($userid,'You drove by <a href=viewuser.php?u={$r['userid']}>{$r['username']}</a> and hospitalized them.',unix_timestamp());");
$db->query("INSERT INTO userattacks VALUES({$r['userid']},'You got drove by from <a href=viewuser.php?u=$userid>{$ir['username']}</a>, and hospitalized you.',unix_timestamp());");

}
else
{
$exp = rand($db_config['minexp'],$db_config['maxexp']);
$hosp = rand($db_config['minhosp'],$db_config['maxhosp']);
 mysql_query("UPDATE users SET brave=brave-$braveuse WHERE userid={$userid}", $c);
 mysql_query("UPDATE users SET hospital=hospital+{$hosp}, hospreason='Wrecked while attempting a drive by.' WHERE userid={$userid}", $c);
 mysql_query("UPDATE users SET exp=exp-{$exp} WHERE userid={$userid}", $c);
 event_add($in, "[url='viewuser.php?u=$userid']{$ir['username']}[/url] attempted to mailbomb you, but the idiot crossed the wires and it exploded in his/her face.", $c);
 print "You call up your gang and load up in your car. You drive down to {$r['username']}s hood.
you see them walking down the street...
Your driver wasnt paying attention and hit a light post and totaled the car 
sending you to the hospital for {$hosp} minutes,
and taking $exp EXP from you.";
 mysql_query("UPDATE inventory SET inv_qty=inv_qty-1 WHERE inv_id={$_GET['cID']}",$c);
 mysql_query("DELETE FROM inventory WHERE inv_qty=0",$c);
$db->query("INSERT INTO userattacks VALUES($userid,'You tried to drive by <a href=viewuser.php?u={$r['userid']}>{$r['username']}</a> and crashed.',unix_timestamp());");
$db->query("INSERT INTO userattacks VALUES({$r['userid']},'<a href=viewuser.php?u=$userid>{$ir['username']}</a> tried to do a drive by, and crashed.',unix_timestamp());");
}
$h->endpage();
?>

Not tested

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