Jump to content
MakeWebGames

bounty hunter


Criminal

Recommended Posts

Hi i attack people on bounty hunter and i dont get any money rewarded game money and the time does not go down too and if failed/succeeded statement. here's the code

 

<?php
include "globals.php";
print "<h2>Bountys</h2>";
switch($_GET['action'])
{
case 'view':
view();
break;

case 'add':
add();
break;

case 'add2':
add2();
break;

case 'remove':
remove();
break;

case 'remove2':
remove2();
break;

case 'claim':
claim();
break;

case 'end':
end2();
break;

case 'reason':
reason();
break;

default:
home();
break;

}
function home()
{
global $db,$ir,$c,$userid,$h;
print "<center>
[[url='bounty.php?action=add'][b]Add a bounty[/b]][/url]


If you choose to take on a bounty, you have 1 hour to complete it. You must hospitalize the target, or else you wont receive the reward. Good luck.


<table width=80%>
<tr bgcolor=#DDDDDD>
<td class='h' align=center>Target</td>
<td class='h' align=center>Reward</td>
<td class='h' align=center>Action</td>
<td class='h' align=center>Reason</td>
</tr>";
$q=mysql_query("SELECT * FROM bountys WHERE bDONE=0 ORDER BY bID DESC",$c) or die(mysql_error());
$i=0;
while($r=mysql_fetch_array($q))
{
$y=mysql_query("SELECT * FROM users WHERE userid={$r['bWHO']}",$c) or die(mysql_error());
$two=mysql_fetch_array($y);
$i++;
$money=money_formatter($r['bMONEY']);
print "<tr class=\"d".($i & 1)."\">";
print "\n<td align=center><a href='viewuser.php?u={$r['bWHO']}'>     {$two['username']}   [{$r['bWHO']}]                                                                                                      
</a></td><td align=center>$money</td>";
if($r['bTAKEN'] == $userid)
{
print "<td align=center>[url='bounty.php?action=end&XID={$r[']<u><font color=brown>End</u></font>[/url]";
}
else if($r['bTAKEN'] > 0)
{
$uy=mysql_query("SELECT * FROM users WHERE userid={$r['bTAKEN']}",$c) or die(mysql_error());
$one=mysql_fetch_array($uy);
print "<td align=center>[i]<font color=purple>Taken by: [url='viewuser.php?u={$r[']<font color=purple><u>{$one['username']} [{$one['userid']}]</u> {$one['bounty']} min(s) left</font>[/url][/i]</font>";
}

else if($r['bTAKEN'] < 0)
{
$who= abs((int) $r['bTAKEN']);
$uy=mysql_query("SELECT * FROM users WHERE userid=$who",$c) or die(mysql_error());
$one=mysql_fetch_array($uy);
print "<td align=center>[i]<font color=blue>Finished by: [url='viewuser.php?u={$one[']<font color=blue><u>{$one['username']} [{$one['userid']}]</u></font>[/url][/i]</font>";
}
else if($r['bADDER'] == $userid)
{
print "<td align=center>[url='bounty.php?action=remove&XID={$r[']<u><font color=blue>Remove</u></font>[/url]";
}
else if($r['bTAKEN'] == 0)
{
print "<td align=center>[url='bounty.php?action=claim&XID={$r[']<u><font color=green>Claim</u></font>[/url]";
}
print "</td>"; 
if(!$r['bREASON']) 
{ 
print "<td align=center>None Given</td>"; 
} 
else 
{ 
print "<td align=center><a href=bounty.php?ID={$r['bID']}&action=reason>> View Reason</a></td>"; 
} 
print "</tr>";
}
print "</table>";
}
function add()
{
global $db,$ir,$c,$userid,$h;

print "<center>[b]Please enter the ID # of the person you are wanting to place a bounty on?
You are only allowed to have 5 bountys at a time.
Minumim bounty is $50,000[/b]
If the person you want to put a bounty on already has a bounty on them, you must at least double the price in order to place it.


[b]<a href=http://knightsadventure.net/gamerules.php#bounty>Click here for the guidelines on bounty reasons!</a>[/b]
<form action=bounty.php?action=add2 method='post'>
User ID#: <input type='text' name='ID' />

Bounty: <input type='text' name='bounty' value='50000' />

Bounty Reason: <input type='text' name='reason' value='A short reason here' />

<input type='submit' value='Submit' /></form>";
}
function add2()
{
global $db,$ir,$c,$userid,$h;
$_POST['ID']= abs((int) $_POST['ID']);
$_POST['bounty']= abs((int) $_POST['bounty']);
if(!$_POST['ID'] || !$_POST['bounty'])
{
die("<center>You have to have both an user and bounty selected

[url='bounty.php?action=add']> Back[/url]");
}
else if($_POST['ID'] == 1 || $_POST['ID'] == 2)
{
die("<center>You cant put a hit on Tyler or Logan
[url='bounty.php?action=add']> Back[/url]");
}
else
{

$q=$db->query("SELECT * FROM users WHERE userid={$_POST['ID']}");
if ($db->num_rows($q) == 0)
{
die("<center>This isnt a real users
[url='bounty.php?action=add']> Back[/url]");
}
$a=$db->query("SELECT * FROM bountys WHERE bWHO={$_POST['ID']}");
if ($db->num_rows($a))
{
die("<center>This users already has a bounty on them.
[url='bounty.php?action=add']> Back[/url]");
}
$b=$db->query("SELECT * FROM bountys WHERE bADDER=$userid AND bTAKEN >= 0");
if ($db->num_rows($b) > 5)
{
die("<center>You are only allowed to have 5 bountys at a time.
[url='bounty.php?action=add']> Back[/url]");
}
else if($_POST['ID'] == $userid)
{
die("<center>You cant place a bounty on yourself silly
[url='bounty.php']> Back[/url]");
}
else if($_POST['bounty'] > $ir['money'] || $_POST['bounty']  < 49999)
{
die( "<center>You do not have enough money to place this bounty or it isnt above $50,000.
[url='bounty.php?action=add']> Back[/url]");
}
else
{
$r=$db->fetch_row($q);
if($r['duties'] == 'NPC')
{
die("<center>You cant place a bounty on an NPC.
[url='bounty.php?action=add']> Back[/url]");
}
print "<center>You have placed a bounty on {$r['username']} [{$r['userid']}]

[url='bounty.php']> Back[/url]";
$re=mysql_real_escape_string($_POST['reason']); 
$reason=htmlspecialchars($_POST['reason']);
mysql_query("INSERT INTO bountys VALUES('',$userid,{$_POST['bounty']},{$_POST['ID']},0,0,0,'$reason')",$c);
mysql_query("UPDATE users SET money=money-{$_POST['bounty']} where userid=$userid",$c);
if($_POST['reason']) 
{ 
event_add($_POST['ID'],"Someone has put a bounty on you with the reason: $reason.",$c); 
} 
else 
{ 
event_add($_POST['ID'],"Someone has put a bounty on you",$c);
}
}
}
}
function remove()
{
global $db,$ir,$c,$userid,$h;
$_GET['XID']= abs((int) $_GET['XID']);
if($_GET['XID'])
{
$q=$db->query("SELECT * FROM bountys WHERE bID={$_GET['XID']}") or die(mysql_error());
$r=$db->fetch_row($q);
if($r['bADDER'] != $userid)
{
die("<center>You do not own this bounty
<a href='bounty.php>> Back</a>");
}
else if($r['bTAKEN'] != 0)
{
die("<center>Someone is currently doing this mission
<a href='bounty.php>> Back</a>");
}
else
{
print "<center>[b]Are you sure you wish to remove this bounty?
[/b]

[url='bounty.php?action=remove2&XID={$_GET[']> Yes[/url]

[url='bounty.php']> No[/url]";
}
}
}
function remove2()
{
global $db,$ir,$c,$userid,$h;
$_GET['XID']= abs((int) $_GET['XID']);
if($_GET['XID'])
{
$q=$db->query("SELECT * FROM bountys WHERE bID={$_GET['XID']}") or die(mysql_error());
$r=$db->fetch_row($q);
if($r['bADDER'] != $userid)
{
die("<center>You do not own this bounty
<a href='bounty.php>> Back</a>");
}
else if($r['bTAKEN'] != 0)
{
die("<center>Someone is currently doing this mission
<a href='bounty.php>> Back</a>");
}
else
{
$db->query("DELETE FROM bountys WHERE bID={$_GET['XID']}");
$db->query("UPDATE users SET money=money+{$r['bMONEY']} WHERE userid=$userid");
print "<center>Bounty removed!

[url='bounty.php']> Back[/url]";
}
}
else
{
print "<center>No bounty selected
[url='bounty']> Back[/url]";
}
}
function claim()
{
global $db,$ir,$c,$userid,$h;
$_GET['XID']= abs((int) $_GET['XID']);
if($_GET['XID'])
{
$q=$db->query("SELECT * FROM bountys WHERE bID={$_GET['XID']}") or die(mysql_error());
$r=$db->fetch_row($q);
if($r['bTAKEN'] != 0)
{
die("<center>Someone already has this bounty
[url='bounty.php']> Back[/url]");
}
else if($ir['bounty'])
{
die("<center>You are already have a bounty you are doing
[url='bounty.php']> Back[/url]");
}
else if($r['bWHO'] == $userid)
{
die("<center>You cant accept the bounty on yourself silly
[url='bounty.php']> Back[/url]");
}
else if($r['bADDER'] == $userid)
{
die("<center>You cant claim the bounty you put silly
[url='bounty.php']> Back[/url]");
}
else
{
print "<center>You have accepted the bounty, you have one hour until it will put it back on the market, good luck.
[b]You must hospitlize the person in order to revice the bounty prize.[/b]
[url='bounty.php']> Back[/url]";
$db->query("UPDATE bountys SET bTAKEN=$userid WHERE bid={$_GET['XID']}") or die(mysql_error());
$db->query("UPDATE users SET bounty=60 WHERE userid=$userid") or die(mysql_error());
}
}
else
{
print "<center>No bounty selected
[url='bounty.php']> Back[/url]";
}
}
function end2()
{
global $db,$ir,$c,$userid,$h;
$db->query("UPDATE bountys SET bTAKEN=0 WHERE bTAKEN=$userid") or die(mysql_error());
$db->query("UPDATE users SET bounty=0 WHERE userid=$userid") or die(mysql_error());
print "<center>You have ended this bounty.
[url='bounty.php']> Back[/url]";
}

function reason()
{
global $db,$ir,$c,$userid,$h;
$ID= abs((int) $_GET['ID']); if(!$ID) { print "Error, go back.<a href=bounty.php>> Back</a>"; }
else { 
$q=$db->query("SELECT bREASON FROM bountys WHERE bID=$ID") or die(mysql_error()); 
$r=$db->fetch_row($q); 
print "[b]This Bountys Reason[/b]


[i]{$r['bREASON']}[/i]

<hr><a href=bounty.php>> Back</a><hr>"; 
} 
}



$h->endpage();
?>
Link to comment
Share on other sites

Re: bounty hunter

 

Hi i attack people on bounty hunter and i dont get any money rewarded game money and the time does not go down too and if failed/succeeded statement. here's the code

Time would go down if u setup the crons for the bounty hunter script, as for no money rewarded, that's part of the crons also. I use v1 and don't use the bounty hunter mod so i'm not sure what the crons are and cba to search.

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