Ok since people want more from me i have created a new mod for credits which is my biggest mod for v2 so far here it is
ok add this into Mysql
alter table `users` add `credits` int(11) default'0';
Create a new file called cctrade.php then add this
<?php
/*Made by Jcvenom
Do not resell this mod
Do not claim making this mod*/
/*------------includes--------------*/
include "globals.php";
/*------------includes--------------*/
echo "<center><main>Credit Exchange</main><hr width = '75%'>";
if($ir['jail'] > 1 || $ir['hospital'] > 1)
{
echo "Sorry this page is not viewable while in jail or hospital!<hr width='75%'/>";
exit();
}
if(!$_GET['step'])
{
echo "<br/>
Welcome to the Credit exchange,
you can come here to spend your credits on special items & gains such as </br />
will boost and much more!
<main>If you don't have any Credits ? <a href='donate.php' target = '_blank'> <font color=brown>Click Here</font></a> to buy Credit Card<hr width = '75%'><table width = '75%' class = 'rounded'><tr><td align = 'center'>
<table width = '95%' style = 'font-weight:800;'><tr bgcolor = '#999999'>
You have <b>".number_format($ir['credits'])."</b> credits.<br/><br/><hr width = '75%'>";
echo "<table width = '75%' class = 'rounded'><tr><td align = 'center'>
<table width = '95%' style = 'font-weight:800;'><tr bgcolor = '#999999'>
<td align = 'left'><center><font color=white>Description</td><td align = 'left'><center><font color=white>Info</td><td align = 'left'><center><font color=white>Cost</td></tr>
<tr class = 'evens'>
<td align = 'left'>• <i>Xanax x 10<td align = 'left'><center> [<a href='cctrade.php?step=xanax'><font color=green>Buy</font></a>]</i></a></td>
<td align = 'left'>2 Credits</td>
</tr>
<tr class = 'evens'>
<td align = 'left'>• <i>Happy Boost (+2500)<td align = 'left'><center> [<a href='cctrade.php?step=happy'><font color=green>Buy</font></a>]</i></a></td>
<td align = 'left'>6 Credits</td>
</tr>
<tr class = 'evens'>
<td align = 'left'>• <i>Energy boost (+500)<td align = 'left'><center> [<a href='cctrade.php?step=booste'><font color=green>Buy</font></a>]</i></a></td>
<td align = 'left'>8 Credits</td>
</tr>
</table>
</td></tr></table>
<hr width = '75%'>><a href='explore.php'>Back</a><hr width = '75%'>";
}
else
{
if(!in_array($_GET['step'],array('xanax',
'happy',
'booste')))
{
echo "Error, Bad request.
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
exit();
}
else
{
if($_GET['step'] == 'xanax')
{
if(!$_POST['step'])
{
echo "<form action = 'cctrade.php?step=xanax' method = 'post'>
Are you sure you wish to swap <b>2</b> credits for x10 Xanax?<br/>
<input type = 'submit' name = 'step' value = 'Continue'>
</form>
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
}
else
{
if($ir['credits'] < 2)
{
echo "Sorry, You dont have enough credits to purchase x10 Xanax.
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
exit();
}
else
{
$db->query("UPDATE `users` SET `credits`=`credits` - '2' WHERE userid=$userid");
$db->query("INSERT INTO inventory VALUES('',ITEMID-HERE,$userid,QUANTITY)");
event_add($ir['userid'],"Success, You have be credited x10 Xanax for 2 credits",$c);
echo "Success, You have be credited x10 Xanax for 2 credits.
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
exit();
}
}
}
else if($_GET['step'] == 'booste')
{
if(!$_POST['step'])
{
echo "<form action = 'cctrade.php?step=booste' method = 'post'>
Are you sure you wish to swap <b>8</b> credits for 500 energy boost?<br/>
<i>Note: This is <b><u>not</u></b> an item, You will recieve a 500 energy boost for a short time.</i><br/>
<input type = 'submit' name = 'step' value = 'Continue'>
</form>
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
}
else
{
if($ir['credits'] < '8')
{
echo "Sorry, You dont have enough credits to purchase a energy boost.
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
exit();
}
else
{
$db->query("UPDATE `users` SET `energy`=`energy` + '500` WHERE userid=$userid");
$db->query("UPDATE `users` SET `credits`=`credits` - '8' WHERE userid=$userid");
event_add($ir['userid'],"You have be credited with 500 energy boost for 8 credits",$c);
echo "Success, You have be credited with 500 energy boost for 8 credits.
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
exit();
}
}
}
else if($_GET['step'] == 'happy')
{
if(!$_POST['step'])
{
echo "<form action = 'cctrade.php?step=happy' method = 'post'>
Are you sure you wish to swap <b>6</b> credits for 2500 happiness?<br/>
<i>Note: This is <b><u>not</u></b> an item, You will recieve 2500 happy for a short time.</i><br/>
<input type = 'submit' name = 'step' value = 'Continue'>
</form>
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
}
else
{
if($ir['credits'] < '6')
{
echo "Sorry, You dont have enough credits to purchase a happy boost.
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
exit();
}
else
{
$db->query("UPDATE `users` SET `will`=`will` + '2500' WHERE userid=$userid");
$db->query("UPDATE `users` SET `credits`=`credits` - '6' WHERE userid=$userid");
event_add($ir['userid'],"You have be credited with 2500 happy for 6 credits",$c);
echo "Success, You have be credited with 2500 happy for 6 credits.
<hr width = '75%'>><a href='cctrade.php'>Back</a><hr width = '75%'>";
exit();
}
}
}
else
{
echo "";
exit();
}
}
}
$h->endpage();
?>
Then add this in globals.php
$cc=money_formatter($ir['credits'],'');
After add this into your header or menubar(As i have my bars in my menubar) or where ever suits you
<b>Credits:</b> {$ir['credits']} <b><a href='cctrade.php'/>[use]</a></b><br />
or
<b>Credits:</b> ".$ir['credits']." <b><a href='cctrade.php'/>[use]</a></b><br />
And your finished very simple mod
Note you can add more steps such as donator packs etc
And you can add to credits to your donation page or wait till i make the creditdonation