Hello Guys,
I made the bank.php into a credit card mod,
Yes the mod was made by me so dont say it was yours!
ok here we go,
Make a file called creditcard.php and put this in it:
<?php
include "globals.php";
print "<center><table width=80% class=h border=1><tr><th>Credit Card</tr><tr>
<td>";
if($ir['creditcard']>-1)
{
switch($_GET['action'])
{
case "deposit":
deposit();
break;
case "withdraw":
withdraw();
break;
default:
index();
break;
}
}
else
{
if(isset($_GET['buy']))
{
if($ir['money']>5000)
{
print "<center>
<hr width='70%'>[i]Thank You {$ir['username']}, You Have Finished Signing up
and Brought your Card for
\$5,000!, We Hope you Enjoy your Stay![/i]<hr width='70%'>
</td></tr></th>";
print "
<table width=80% cellspacing=1 class='table'>
<tr><th>
[url='creditcard.php']- Click Here to Start Using your Credit Card -[/url]</th></tr>";
print "
<table width=80% cellspacing=1 class='table'>
<tr><th>
[url='explore.php']- Click Here to Go to Explore -[/url]</th></tr>";
$db->query("UPDATE users SET money=money-5000,creditcard=0 WHERE userid=$userid");
}
else
{
print "<center>
<hr width='70%'>[i]You do not have enough Money to Buy a Credit Card!<hr width='70%'>
</td></tr></th>";
print "
<table width=80% cellspacing=1 class='table'>
<tr><th>
[url='explore.php']- Click Here to Go to Explore -[/url]</th></tr>";
}
}
else
{
print "<center>
<hr width='70%'>[i]<font color=blue>Welcome to your Local Bank!</font>
We have Noticed you Currently Havnt got a Credit Card
If you wish to Sign up Please feel Free
![i]<hr width='70%'>
<font color=#666666>Please Read The Credit Card Information Below before Signing Up
</font></center>
</td></tr></th></table>";
print "
<table width=80% class=h border=1>
<tr><th>Credit Card Information</a></tr><tr>
<td><center>
<hr width='85%'>Our Credit Cards do not Provide Interest and Withdrawal Fees, If you wish to
Have Interest Then you should Sign up for the [url='bank.php']<font color=red>Bank</font>[/url] (Which Costs More), You
will only have One Credit Card, and one Credit Card only!
If you get Caught
trying to Hack the Credit Card Machine, Then that will lead to a Fed Sentence
for a Long Long Time, If you Wish to Sign up then please Click (Sign Up),
Thank You for Taking your Time Reading this!<hr width='85%'>
[img=creditcard.png]
<hr width='70%'>
[i]<font color='#666666'>Please Click (Sign Up) to Continue or (Back) To go Back to Explore</font>[/i]
<hr width='70%'>
</td></tr></th>";
print "
<table width=80% cellspacing=1 class='table'>
<tr><th>[url='creditcard.php?buy']- Click Here to Sign up for a Credit Card Now For Just \$5,000! -[/url]</th></tr>";
print "
<table width=80% cellspacing=1 class='table'>
<tr><th>
[url='explore.php']- Click Here to Go Back to Explore -[/url]</th></tr>";
}
}
function index()
{
global $db, $ir,$c,$userid,$h;
print "<hr width='70%'><center>[i]Welcome Back {$ir['username']},
You currently have \${$ir['creditcard']} Money in your Credit Card![/i]<hr width='70%'>
[img=creditcard.png]
<table width='75%' cellspacing=1 class='table'> <tr> <td width='50%'>
<center><hr width='50%'>[b]Deposit Money[/b]
There is no Fee on Deposits!<hr width='50%'>
<form action='creditcard.php?action=deposit' method='post'>
Amount: <input type='text' name='deposit' value='{$ir['money']}' /> <input type='submit' value='Deposit' /></form></td> </tr> </table>
";
print "
<table width='75%' cellspacing=1 class='table'> <tr> <td width='50%'>
<center><hr width='50%'>[b]Withdraw Money[/b]
There is no Fee on Withdrawals!<hr width='50%'><form action='creditcard.php?action=withdraw' method='post'>
Amount: <input type='text' name='withdraw' value='{$ir['creditcard']}' /> <input type='submit' value='Withdraw' /></form></td> </tr> </table>
";
print "
</td><table width=80% cellspacing=1 class='table'>
<tr><th>
[url='explore.php']- Click Here to Go Back to Explore -[/url]</th></tr>";
}
function deposit()
{
global $db,$ir,$c,$userid,$h;
$_POST['deposit']=abs((int) $_POST['deposit']);
if($_POST['deposit'] > $ir['money'])
{
print "<hr width='70%'>[i]<center>You Havnt Got Enough Money to Deposit![/i]<hr width='70%'>";
print "
</td><table width=80% cellspacing=1 class='table'>
<tr><th>
[url='creditcard.php']- Go Back -[/url]</th></tr>";
}
else
{
$gain=$_POST['deposit']-$fee;
$ir['creditcard']+=$gain;
$db->query("UPDATE users SET creditcard=creditcard+$gain, money=money-{$_POST['deposit']} where userid=$userid");
print "<hr width='70%'><center>[i]You go to The Local Bank and hand over \${$_POST['deposit']}
To be Deposited to your Credit Card!
\$$gain is Added to your Credit Card!
[b]You now have \${$ir['creditcard']} in Your Credit Card![/b][/i]<hr width='70%'>
";
print "
</td><table width=80% cellspacing=1 class='table'>
<tr><th>
[url='creditcard.php']- Go Back -[/url]</th></tr>";
}
}
function withdraw()
{
global $db,$ir,$c,$userid,$h;
$_POST['withdraw']=abs((int) $_POST['withdraw']);
if($_POST['withdraw'] > $ir['creditcard'])
{
print "<hr width='70%'>[i]<center>You do not have Enough Money
In Your Credit Card to Withdraw this Amount![/i]<hr width='70%'>";
print "
</td><table width=80% cellspacing=1 class='table'>
<tr><th>
[url='creditcard.php']- Go Back -[/url]</th></tr>";
}
else
{
$gain=$_POST['withdraw'];
$ir['creditcard']-=$gain;
$db->query("UPDATE users SET creditcard=creditcard-$gain, money=money+$gain where userid=$userid");
print "<hr width='70%'><center>[i]You go to the Machine and Decide to Withdraw \$$gain,
You wait a Few Seconds and then you get your Money!
[b]You now have \${$ir['creditcard']} in Your Card![/b][/i]<hr width='70%'>
";
print "
</td><table width=80% cellspacing=1 class='table'>
<tr><th>
[url='creditcard.php']- Go Back -[/url]</th></tr>";
}
}
$h->endpage();
?>
next Upload this Picture in the same place as where you have put creditcard.php:
Call the file creditcard.png
Right click and save the image, And yes i made the Image to,
Now run this SQL:
ALTER TABLE `users` ADD `creditcard` int(11) NOT NULL default '-1'
Edit explore.php and find this line:
[url='estate.php']Estate Agent[/url]
ADD After
[url='creditcard.php']Credit Card[/url]
Edit Header.php and find this line:
Money: \${$ir['money']}
ADD After:
Credit Card: \${$ir['creditcard']}
Screenshots:
Enjoy! :D
EDIT: This is the Addon so you can buy items out off the shop with your Credit Card
Replace shops.php with this one:
<?php
include "globals.php";
$_GET['shop'] = abs((int) $_GET['shop']);
if(!$_GET['shop'])
{
print "You begin looking through town and you see a few shops.
";
$q=$db->query("SELECT * FROM shops WHERE shopLOCATION={$ir['location']}");
print "<table width=85% cellspacing=1 class='table'><tr style='background: gray;'><th>Shop</th><th>Description</th></tr>";
while($r=$db->fetch_row($q))
{
print "<tr><td>[url='shops.php?shop={$r[']{$r['shopNAME']}[/url]</td><td>{$r['shopDESCRIPTION']}</td></tr>";
}
print "</table>";
}
else
{
$sd=$db->query("SELECT * FROM shops WHERE shopID={$_GET['shop']}");
if($db->num_rows($sd))
{
$shopdata=$db->fetch_row($sd);
if($shopdata['shopLOCATION'] == $ir['location'])
{
print "Browsing items at [b]{$shopdata['shopNAME']}...[/b]
<table cellspacing=1 class='table'><tr style='background: gray;'><th>Item</th><th>Description</th><th>Price</th><th>Sell Price</th><th>Buy</th><th>Buy with Credit Card</th></tr>";
$qtwo=$db->query("SELECT si.*,i.*,it.* FROM shopitems si LEFT JOIN items i ON si.sitemITEMID=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE si.sitemSHOP={$_GET['shop']} ORDER BY i.itmtype ASC, i.itmbuyprice ASC, i.itmname ASC");
$lt="";
while($r=$db->fetch_row($qtwo))
{
if($lt!=$r['itmtypename'])
{
$lt=$r['itmtypename'];
print "\n<tr style='background: gray;'><th colspan=6>{$lt}</th></tr>";
}
$buyprice=money_formatter($r['itmbuyprice']);
$sellprice=money_formatter($r['itmsellprice']);
$creditcardbuyprice=money_formatter($r['itmbuyprice']);
?><tr><td><? echo $r['itmname']; ?></td><td><? echo $r['itmdesc']; ?></td><td><? echo $buyprice; ?></td><td><? echo $sellprice; ?></td><td><form action='itembuy.php?ID=<? echo $r['itmid']; ?>' name="shopbuy" method='post'>
Qty: <input type='text' name='qty' value='1' onkeyup="tot(<? echo $r['itmid']; ?>,<? echo $r['itmbuyprice']; ?>,this.value);" onfocus="clearText(this);" onblur="returnText(this);" /><input type='submit' value='Buy' /></form><div id="res<? echo $r['itmid']; ?>" align="center"></div></td><td>
<form action='creditcarditembuy.php?ID=<? echo $r['itmid']; ?>' name="shopbuy" method='post'>
Qty: <input type='text' name='qty' value='1' onkeyup="tot(<? echo $r['itmid']; ?>,<? echo $r['itmbuyprice']; ?>,this.value);" onfocus="clearText(this);" onblur="returnText(this);" /><input type='submit' value='Buy' /></form><div id="res<? echo $r['itmid']; ?>" align="center"></div></td>
</tr>
<?
}
print "</table>";
}
else
{
print "You are trying to access a shop in another city!";
}
}
else
{
print "You are trying to access an invalid shop!";
}
}
$h->endpage();
?>
And now make a file Called creditcarditembuy.php and put this in it:
<?php
include "globals.php";
if($set['weapon_c_n']>1)
{
$aphd=$db->query("SELECT crNAME FROM courses WHERE crID={$set['weapon_c_n']}");
$aphd=$db->fetch_row($aphd);
$phd=$db->query("SELECT edu FROM phds WHERE userid=$userid && edu={$set['weapon_c_n']}");
if($db->num_rows($phd)==0)
{
die("You need the {$aphd['crNAME']} PHD to buy weapons!!");
}
}
if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); }
$_GET['ID']= abs((int) $_GET['ID']);
$_POST['qty']= abs((int) $_POST['qty']);
if(!$_GET['ID'] || !$_POST['qty'])
{
print "Invalid use of file";
}
else if($_POST['qty'] <= 0)
{
print "You have been added to the delete list for trying to cheat the game.";
}
else
{
$q=$db->query("SELECT * FROM items WHERE itmid={$_GET['ID']}");
if(mysql_num_rows($q) == 0)
{
print "Invalid item ID";
}
else
{
$itemd=$db->fetch_row($q);
if($ir['creditcard'] < $itemd['itmbuyprice']*$_POST['qty'])
{
print "You don't have enough Money in your Card to buy this Item!";
$h->endpage();
exit;
}
if($itemd['itmbuyable'] == 0)
{
print "This item can't be bought!";
$h->endpage();
exit;
}
$price=($itemd['itmbuyprice']*$_POST['qty']);
item_add($userid, $_GET['ID'], $_POST['qty']);
$db->query("UPDATE users SET creditcard=creditcard-$price WHERE userid=$userid");
$db->query("INSERT INTO itembuylogs VALUES ('', $userid, {$_GET['ID']}, $price, {$_POST['qty']}, unix_timestamp(), '{$ir['username']} bought {$_POST['qty']} {$itemd['itmname']}(s) for {$price}')");
print "You bought {$_POST['qty']} {$itemd['itmname']}(s) for \$$price";
}
}
$h->endpage();
?>
There now you have added the addon, Enjoy! :D