jamiee Posted August 14, 2011 Share Posted August 14, 2011 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"); ?> Quote Link to comment Share on other sites More sharing options...
MysteriousD Posted August 14, 2011 Share Posted August 14, 2011 please post an explanation or description of what it does? but thanks for releasing it on this forum ;) Quote Link to comment Share on other sites More sharing options...
jamiee Posted August 14, 2011 Author Share Posted August 14, 2011 its pretty simple really, you type a target's name in that you want to kill and it works out how many bullets you need to use to kill them by what level they are. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.