Jump to content
MakeWebGames

Bullet Calculator


jamiee

Recommended Posts

save this file as bullet_calculator.php and add a link to top.php and your done :D

 

<?php require("top.php"); ?>
<?
require("usercheck.php");
require("prison_check.php");
?>  
<?php             
if(isset($_POST['cal'])){

if(in_array($_POST['tar'], $admin_array) or in_array($_POST['tar'], $manager_array)){
   echo "The Number of bullets needed to kill ".$_POST['tar']." is too much.";
}else{

$sql = "SELECT * FROM login WHERE name='".$_POST['tar']."'";
$query = mysql_query($sql);
$fetch = mysql_fetch_object($query);
$target_name = $fetch->name;
$target_rank = $fetch->rank;
$target_health = $fetch->health;
$target_armor = $fetch->armor;

if(empty($_POST['tar'])){
   echo "You didn't enter a taget";
}else{
if(empty($target_name)){
   echo "The target does not exist";
}else{
if($money < 10000){
   echo "You do not have enough money to calculate you need $ 10,000,-";
}else{

$sql = "UPDATE login SET money=money-'10000' WHERE name='$name'";
$query = mysql_query($sql);

   $bb = $target_rank * ( 700 * round($target_rank / 2) ) + ((8 + $target_armor) * (550 * $target_rank) - ($weapon * (550 * $target_rank))) ;
   $bullets_needed = round($bb/100) * $target_health;
   $bullets_needed = number_format($bullets_needed);

   echo "The Maximum Number of bullets needed to kill ".$_POST['tar']." is $bullets_needed";

$sql = "SELECT * FROM login WHERE name='".$name."'";
$query = mysql_query($sql);
$fetch = mysql_fetch_object($query);
$money = $fetch->money;

}
}
}
}
}    
   ?>
<form id="form1" name="form1" method="post" action="">
 <table width="220" border="0" cellpadding="0" cellspacing="2" class="table">
   <tr>
     <td colspan="2" align="left" class="head">Bullet Calculator.</td>
   </tr>
<tr>
   <td width="300" align="left" class="sub"><b>Calculating bullets will cost $10,000.</b></td>
 </tr>
 <tr>
   <td width="280" align="left" class="sub"><b>Target Name:</b></td>
 </tr>

 <tr>
   <td width="150" align="left" class="cell"><input name="tar" id="tar" class="entryfield" type="text" maxlenth="20" /></td>
 </tr>
 <tr>
   <td width="150" align="center" class="submit"><input name="cal" id="cal" class="button" type="submit" maxlenth="20" value="Calculate." /></td>
 </tr>
</table>
<br />
</form>
<?php require("bottom.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...