Re: Little crystal cap thing.
I think this is great but i did a little add to it, What that is it sends an event to the owner saying that this person was trying to post crystals higher then the cap, I will post both the versions first i post the one you did then i will post the add to it, I'm sorry if you get upset or angry i am just trying to help make it easier, Also this add is for v2 but to make it for v1 simply take $db, out of this part of the code.
global $db,$ir,$c,$userid,$h;
function crystal_add()
{
global $ir,$c,$userid,$h;
$_POST['amnt'] = abs((int) $_POST['amnt']);
$_POST['price'] = abs((int) $_POST['price']);
if($_POST['amnt'])
{
if($_POST['amnt'] > $ir['crystals'])
{
die ("You are trying to add more crystals to the market than you have.
[url='cmarket.php']> Back[/url]");
}
else if ( $_POST['price'] > 10000 )
{
die ("The maximum you can charge for crystals is $10,000 each
[url='cmarket.php']> Back[/url]");
}
change that to this
function crystal_add()
{
global $db,$ir,$c,$userid,$h;
$_POST['amnt'] = abs((int) $_POST['amnt']);
$_POST['price'] = abs((int) $_POST['price']);
if($_POST['amnt'])
{
if($_POST['amnt'] > $ir['crystals'])
{
stafflog_add("{$ir['username']}, Is trying to list more crystals on the market then they have",$c);
die ("You are trying to add more crystals to the market than you have.");
}
$tp=$_POST['amnt']*$_POST['price'];
if($_POST['price'] > 10000)
{
stafflog_add("{$ir['username']}, Is trying to list crystals on the market higher than the cap",$c);
die ("The maximum you can charge for crystals is $100,000 each
[url='cmarket.php']> Back[/url]");
}
Let me know if it don't work.