spazz Posted September 2, 2008 Posted September 2, 2008 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 Quote
Haunted Dawg Posted September 2, 2008 Posted September 2, 2008 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. Quote
spazz Posted September 2, 2008 Author Posted September 2, 2008 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? Quote
Haunted Dawg Posted September 2, 2008 Posted September 2, 2008 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. Quote
spazz Posted September 2, 2008 Author Posted September 2, 2008 Re: Bank Cap (Not Remove The Cap) that seems to work, thanks. Theoretically the interest should not go in...correct? We will see once the cron runs Quote
Haunted Dawg Posted September 3, 2008 Posted September 3, 2008 Re: Bank Cap (Not Remove The Cap) Interest will go in but once they click on the bank it will take there money and put it on hand. Quote
AlabamaHit Posted September 3, 2008 Posted September 3, 2008 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']> 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']> Back[/url]"; $h->endpage; exit; } Quote
Haunted Dawg Posted September 3, 2008 Posted September 3, 2008 Re: Bank Cap (Not Remove The Cap) I would say use mine rather. Your member's will be more happier to get the money to there hand than to go no where. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.