Jump to content
MakeWebGames

Bank Cap (Not Remove The Cap)


spazz

Recommended Posts

I am trying to limit the amount a player can add to the bank. I know the default setting allows the cap of $2147483647. I want to set the cap to $2,000,000, mind you I am not trying to increase the capacity. I have been playing with this for a week or so and have seen some posts on the forum but they do not work. Can someone push me in the right direction please? Any help would be helpful, thanks

Link to comment
Share on other sites

Re: Bank Cap (Not Remove The Cap)

 

if($_POST['amount'] > 2000000)
{
     echo 'Sorry but you can only post an amount below \$2,000,000';
     $h->endpage();
     exit;
}

 

Or

 

if($_POST['amount'] < 2000000)
{
     echo 'Sorry but you can only post an amount below \$2,000,000';
     $h->endpage();
     exit;
}

 

Might need to check up on the $_POST['amount'] i dont remember what it is.

Im not familiar with the ( < > ) lol i keep getting confused.

Link to comment
Share on other sites

Re: Bank Cap (Not Remove The Cap)

Thanks for the response killah.

if($_POST['deposit'] is what you were looking for.

 

I reread my post, I think I worded it wrong. My OP gave the impression of a max deposit of 2 Million :|

I actually meant to say I would like the bank to hold a maximum of 2 Million, not sure if that is something you can help with?

Link to comment
Share on other sites

Re: Bank Cap (Not Remove The Cap)

Going to need to ask some one else about that, its more mysql side.

Add a thing at the top:

 

if($ir['bank_money'] > 2000000)
{
     $bank = $ir['bank_money']-2000000;
     mysql_query("UPDATE users SET bank_money=2000000,money=money+".$bank." WHERE userid=".$ir['userid']);
     echo 'You may only hold up to '.money_formatter(2000000).' in your bank account. '.money_formatter($bank).' has been put in your hand.';
}

 

That should work.

Link to comment
Share on other sites

Re: Bank Cap (Not Remove The Cap)

just go into your day cron and add something like..

$db->query("UPDATE users SET bankmoney = 2000000 WHERE bankmoney > 2000000");

thats will make it where if the interest goes over it will set back to 2 million without giving money to them...Just make sure its AFTER the query that gives the interst..so put it at the bottom of page...also in bank.php should be like..

 


This one stops them depositing over 2 million...

if($_POST['deposit'] > 2000000)
{
print "Say somethign here..


[url='bank.php']&gt Back[/url]";
$h->endpage;
exit;
}

and also you need thiis...

This one stops them from depsiting over 2 million also  but notice the bank money...cuase if you just block with first i could easly just depost 1.5 million every time and go over it...but with this it will add there deposit and there bankmoney together and if combined it will stop them.

if($_POST['deposit'] + $ir['bankmoney'] > 2000000)
{
print "Say somethign here..


[url='bank.php']&gt Back[/url]";
$h->endpage;
exit;
}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...