function index()
{
global $ir, $c, $userid;
$interest = $ir['bankmoney'] / 100 * 2;
$interests = money_formatter($interest);
$balance = money_formatter($ir['bankmoney']);
echo "\n\n<b>You currently have {$balance} in the bank.</b><br />\nAt the end of each day, your bank balance will go up by 2%.<br/>Interest each day for the current deposit is {$interests}<br />\n<table width=100% class = table border=1> <tr><th>Deposit</th><th>Withdraw</th></tr><tr>\n<td>\nWhen adding to your account 2% is taken from you<br>\n<form action='?action=Deposit' method='post'>\nAmount: <input type='text' STYLE='color: black; background-color: white;' name='dt' value='{$ir['money']}' /><br />\n<input type='submit' STYLE='color: black; background-color: white;' value='Deposit' /></form></td>\n\n<td>\nWithdrawl cash. No money is taken for withdrawl.\n<form action='?action=Withdraw' method='post'>\nAmount: <input type='text' STYLE='color: black; background-color: white;' name='wd' value='{$ir['bankmoney']}' /><br />\n<input type='submit' STYLE='color: black; background-color: white;' value='Withdraw' /></form></td></tr>";
echo "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>";
}
$q = mysql_query("SELECT * FROM votes WHERE userid={$userid} AND site='{$_GET['ID']}'", $c);
if (mysql_num_rows($q) > 0) {
print "You have already voted on this site today!";
die("");
} else {
$blak = mysql_query("SELECT * FROM votingsites WHERE id={$_GET['ID']}", $c);
if ($db->num_rows($blak) == 0) {
print "<center>This voting site does not exist!</center>";
die("");
} else {
$r = mysql_fetch_array($blak);
}
$id = $_GET['ID'];
$reward = $r['reward'];
if ($r['rewardtype'] == 1) {
$muneh = money_formatter($reward);
mysql_query("INSERT INTO votes values ({$userid},{$id})", $c);
event_add($userid, "Thank you for voting! You have receieved {$muneh}!", $c);
mysql_query("UPDATE users SET money=money+{$reward} WHERE userid={$userid}", $c);
}
if ($r['rewardtype'] == 2) {
mysql_query("INSERT INTO votes values ({$userid},{$id})", $c);
if ($reward > 1) {
event_add($userid, "Thank you for voting! You have receieved {$reward} crystals!", $c);
} else {
event_add($userid, "Thank you for voting! You have receieved {$reward} crystal!", $c);
}
mysql_query("UPDATE users SET crystals=crystals+{$reward} WHERE userid={$userid}", $c);
}
if ($r['rewardtype'] == 3) {
$juk = mysql_query("SELECT * FROM items WHERE itmid={$reward}", $c);
| Software Version : Version 2.0.1 Build 2101
| Website : http://www.ravan.info/
| E-mail : [email protected]
|**************************************************************************************************
| The source files are subject to the Ravan Scripts End-User License Agreement included in License Agreement.html
| The files in the package must not be distributed in whole or significant part.
| All code is copyrighted unless otherwise advised.
| Do Not Remove Powered By Ravan Scripts without permission .
|**************************************************************************************************
| Copyright (c) 2010 Ravan Scripts . All rights reserved.
|**************************************************************************************************/
include "globals.php";
print "\r\n\r\n<div class='generalinfo_txt'>\r\n<div><img src='images/info_left.jpg' alt='' /></div>\r\n<div class='info_mid'><h2 style='padding-top:10px;'> Battle Tent</h2></div>\r\n<div><img src='images/info_right.jpg' alt='' /></div> </div>\r\n<div class='generalinfo_simple'><br> <br><br>\r\n\r\n\r\n<b>Welcome to the battle tent! Here you can challenge NPCs for money.</b>\r\n<table width=90% cellspacing=1 class='table'><tr style='background: gray; '><th>Bot Name</th><th>Level</th><th>Times Owned</th><th>Ready To Be Challenged?</th><th>Location</th><th>Money Won</th><th>Challenge</th></tr>";
$q = $db->query("SELECT cb.*,u.*,c.npcid,cy.cityname FROM challengebots cb LEFT JOIN users u ON cb.cb_npcid=u.userid LEFT JOIN challengesbeaten c ON c.npcid=u.userid AND c.userid={$userid} LEFT JOIN cities cy ON u.location=cy.cityid");
while ($r = $db->fetch_row($q)) {
$earn = money_formatter($r['cb_money']);
$v = $r['userid'];
$q2 = $db->query("SELECT count(*) FROM challengesbeaten WHERE npcid={$userid}");
$times = $db->fetch_single($q2);
print "<tr><td>{$r['username']}</td><td>{$r['level']}</td><td>{$times}</td><td>";
if ($r['hp'] >= $r['maxhp'] / 2 and $r['location'] == $ir['location'] and !$ir['hospital'] and !$ir['jail'] and !$r['hospital'] and !$r['jail']) {
print "<font color=green>Yes</font>";
} else {
print "<font color=red>No</font>";
}
print "</td><td>{$r['cityname']}</td><td>{$earn}</td><td>";
if ($r['npcid']) {
print "<i>Already</i>";
} else {
print "<a href='attack.php?ID={$r['userid']}'>Challenge</a>";
}
function rob_business()
{
global $ir, $db, $h, $userid;
$_GET['id'] = abs(@intval($_GET['id']));
if ($_GET['id']) {
$fetch_business = $db->query(sprintf("SELECT * FROM `businesses` LEFT JOIN `businesses_classes` ON (`classId` = `busClass`) LEFT JOIN `users` ON (`userid` = `busDirector`) WHERE (`busId` = '%u')", $_GET['id']));
if (!$db->num_rows($fetch_business)) {
echo 'You cannot rob a company that doesn\'t exist.';
} else {
$r = $db->fetch_row($fetch_business);
if ($ir['rob'] == 1) {
echo 'You cannot attempt to rob a company more than once a day!';
$h->endpage();
exit;
}
if ($ir['userid'] == $r['busDirector']) {
echo 'Why would you attempt to rob your own company?';
$h->endpage();
exit;
} else {
if ($ir['robskill'] <= $r['bussecurity']) {
print "\n\n\n<h1><font color=red>BUSTED !! </font></h1> <br><br> \n\n<div id='mainOutput' style='text-align: center; color: white; width: 600px; border: 1px solid #222222; height: 70px;\nmargin: 0 auto 10px; clear: both; position: relative; left: -20px; padding: 8px'>\n\nWhile attempting to break into the business, greedy with plans of large bucks. You fail to notice the police car driving by. Just as you crack the lock and begin to head inside you are knocked over the head. You wake up in jail with a raging headache and the discovery YOU WERE CAUGHT";
event_add($_GET['id'], "<a href='viewuser.php?u={$userid}'>{$ir['username']}</a> Attempted to Rob your Business but was caught.");
$jailtime = mt_rand(10, 40);
$query = sprintf('UPDATE users SET jail = jail +%u, jail_reason = "Failed to Rob %s.", rob = 0 WHERE userid = %u', $jailtime, $r['busName'], $userid);
$db->query($query);
$db->query("UPDATE users SET rob = rob + 1 WHERE userid = {$userid}");
$db->query("UPDATE businesses SET bussecurity = bussecurity + 1 WHERE busId = {$_GET['id']}");
business_alert($r['busId'], " Someone tried to rob from your company and got busted ! ");
} else {
if ($ir['robskill'] > $r['bussecurity']) {
$rando = mt_rand(10, 25);
$cash = round($r['busCash'] / $rando);
print "\n\n<h1><font color=green>SUCESS !! </font></h1> <br><br> \n\n<div id='mainOutput' style='text-align: center; color: white; width: 600px; border: 1px solid #222222; height: 70px;\nmargin: 0 auto 10px; clear: both; position: relative; left: -20px; padding: 8px'>\n\n\nAfter scoping out the latest company for a few days, you decide now is your chance to do some damage. You sneak up to the backdoor after dark and jiggle the lock. With a bit of luck on your side, the door is unlocked. You sneak in flashlight in hand and head for the vault. Noticing the lack of security in this place you are hopeful someone hasn't beat you to the punch. As you enter the dark office where the stash of cash is located it would appear luck is on your side twice! The owner left the key to the safe on his desk! You quickly grab the cash and bolt. You earned yourself a nice smooth {$cash} cash.";
$db->query("UPDATE users SET money = money + {$cash}, rob = 0 WHERE userid = {$userid}");
$db->query("UPDATE users SET rob = rob + 1 WHERE userid = {$userid}");
$db->query("UPDATE businesses SET busCash = busCash - {$cash}, bussecurity = bussecurity - 1 WHERE busId = {$_GET['id']}");
$robbery = $money = money_formatter($cash);
business_alert($r['busId'], " Someone successfully robbed {$robbery} from your company ! ");
}
}
}
}
}
}
请发表评论