javance Posted January 14, 2012 Share Posted January 14, 2012 how do you make it where you can make how many cash you want into the bank like the max amount 99999999999999999999999999999999999999999999999 and thats the max amount for withdraw, need help Quote Link to comment Share on other sites More sharing options...
Dominion Posted January 14, 2012 Share Posted January 14, 2012 The bank has a cap for a reason. Assuming you have not changed it would the cap happen to stand at 2.14bill? http://dev.mysql.com/doc/refman/5.0/en/integer-types.html Quote Link to comment Share on other sites More sharing options...
javance Posted January 14, 2012 Author Share Posted January 14, 2012 idont know where the bannk php stuff at in the sql can you tell me, cuz i already know about that cuz my stats go up to 255,000,000,000,000,000,000,000,000,000 or more i forgot, its around that Quote Link to comment Share on other sites More sharing options...
Dominion Posted January 14, 2012 Share Posted January 14, 2012 My guess would be that it's around "2147483647", and the amount of money in a user's bank account is stored in the user table. Quote Link to comment Share on other sites More sharing options...
javance Posted January 14, 2012 Author Share Posted January 14, 2012 ok i been un did that i mean i need it to where i can deposit as much money as i want instead of depositing just that amount each time, same with withdrawing Quote Link to comment Share on other sites More sharing options...
Dominion Posted January 14, 2012 Share Posted January 14, 2012 ok i been un did that i mean i need it to where i can deposit as much money as i want instead of depositing just that amount each time, same with withdrawing Well assuming you mean the bank file you have has some pre-set cap by it's creator open the file, and find it. Quote Link to comment Share on other sites More sharing options...
javance Posted January 14, 2012 Author Share Posted January 14, 2012 (edited) <?php include_once(DIRNAME(__FILE__) . '/globals.php'); echo "<h3>Town Bank</h3><h4>Welcome to the Bank, Here you can deposit your cash to keep it safe from other players!</h4><br />"; if ($ir['bankmoney'] > -1) { switch ($_GET['page']) { case "deposit": deposit(); break; case "withdraw": withdraw(); break; default: index(); break; } } else { if (isset($_GET['buy'])) { if ($ir['money'] > 49999) { echo "<b>Success:</b> You have paid <b>$50,000</b> for a bank account.<br /> Would you like to go to your bank account?<br /><br /> <a href='bank.php'>Yes</a> | <a href='explore.php'>No</a>"; $db->query("UPDATE users SET money=money-1000,bankmoney=0 WHERE userid=$userid"); } else { echo "<b>Error:</b> You do not have enough cash to open an account!<br /><br /> > <a href='explore.php'>Back</a>"; } } else { echo "<b>Bank Manager:</b> Hey, <i>" . $ir['username'] . "</i>, Welcome to the Bank.<br /> Here you can deposit your cash so it doesn't get stolen by other players.<br /> To open a bank account it will cost <b>$50,000</b>, Would you like to open an account?<br /><br /> <br /><a href='bank.php?buy'>Yes please</a> | <a href='explore.php'>No thanks</a>"; } } function index() { global $db, $ir, $c, $userid, $h; echo "You currently have <b>" . money_formatter($ir['bankmoney']) . "</b> in your bank account.<br /><br /> <table width='80%' class='table'><tr><th width='50%'>Deposit Cash</th><th>Withdraw Cash</th></tr> <tr><td style='text-align:center;'> <br /> <form action='bank.php?page=deposit' method='post'> <input type='text' name='deposit' value='{$ir['money']}' /><br /> <input type='submit' value='Deposit' /></form></td> <td style='text-align:center;'> <br /><form action='bank.php?page=withdraw' method='post'> <input type='text' name='withdraw' value='{$ir['bankmoney']}' /><br /> <input type='submit' value='Withdraw' /></form></td> </tr> </table>"; } function deposit() { global $db, $ir, $c, $userid, $h; $_POST['deposit'] = abs((int) $_POST['deposit']); if ($_POST['deposit'] > $ir['money']) { echo "<b>Error:</b> You do not have enough cash to deposit that amount!<br /><br /> > <a href='bank.php'>Back</a>"; } else { $fee = ceil($_POST['deposit'] * 100 / 100); if ($fee > 0) { $fee = 0; } $gain = $_POST['deposit'] - $fee; $ir['bankmoney'] += $gain; $db->query("UPDATE users SET bankmoney=bankmoney+$gain, money=money-{$_POST['deposit']} where userid=$userid"); echo "You hand over <b>" . money_formatter($_POST['deposit']) . "</b> to be added into your bank account.<br /><br /> <b>Bank Manager:</b> Okay <i>" . $ir['username'] . "</i>, The cash has been added to your bank account.<br /><br /> You now have <b>" . money_formatter($ir['bankmoney']) . "</b> in your bank account.<br /><br /> > <a href='bank.php'>Back</a>"; } } function withdraw() { global $db, $ir, $c, $userid, $h; $_POST['withdraw'] = abs((int) $_POST['withdraw']); if ($_POST['withdraw'] > $ir['bankmoney']) { echo "<b>Error:</b> You do not have enough banked cash to withdraw that amount!<br /><br /> > <a href='bank.php'>Back</a>"; } else { $gain = $_POST['withdraw']; $ir['bankmoney'] -= $gain; $db->query("UPDATE users SET bankmoney=bankmoney-$gain, money=money+$gain where userid=$userid"); echo "You ask for <b>\$" . $gain . "</b> to be taken from your account.<br /><br /> <b>Bank Manager:</b> Okay <i>" . $ir['username'] . "</i>, Here is your cash.<br /><br /> You now have <b>" . money_formatter($ir['bankmoney']) . "</b> in your bank account.<br /><br /> > <a href='bank.php'>Back</a>"; } } $h->endpage(); ?> tHEY DONT HAVAE IT IN THERE, ANY SUGGESTIONS Edited January 14, 2012 by Dominion added code tags Quote Link to comment Share on other sites More sharing options...
Dominion Posted January 14, 2012 Share Posted January 14, 2012 tHEY DONT HAVAE IT IN THERE, ANY SUGGESTIONS What's the current cap? Quote Link to comment Share on other sites More sharing options...
javance Posted January 14, 2012 Author Share Posted January 14, 2012 2147483647 Quote Link to comment Share on other sites More sharing options...
H4x0r666 Posted January 14, 2012 Share Posted January 14, 2012 (edited) INT can go as low as -2147483648 and so high as 2147483648 and BIGINT can go as low as -9223372036854775808 and so high as 9223372036854775808 which is a huge difference.. Maybe it has something to do with the INT in these lines?? (in the script you posted.. -.-") on line 44; $_POST['deposit'] = abs((int) $_POST['deposit']); on line 64; $_POST['withdraw'] = abs((int) $_POST['withdraw']); :p Edited January 14, 2012 by H4x0r666 Quote Link to comment Share on other sites More sharing options...
Nickson Posted January 14, 2012 Share Posted January 14, 2012 2147483647 is the maximum value a signed integer can hold. The issue might not be php, but mysql has troubles with this as the maximum value will never exceed 2147483647. Changing the data type in the database might help. Change this to bigint for larger numbers. Otherwise php doesn't seem to make much of a problem of it. It just changes ints to floats... $var = 2147483648; $var = abs((int) $var); var_dump($var); output: float(2147483648) Quote Link to comment Share on other sites More sharing options...
Danny696 Posted January 14, 2012 Share Posted January 14, 2012 (edited) how do you make it where you can make how many cash you want into the bank like the max amount 99999999999999999999999999999999999999999999999 and thats the max amount for withdraw, need help Sorry, but why on earth would a player have more than 2 billion in a game? The game seems to have an economy worse than the eurozone, and the stats, maybe you should lower the gains from the gym, but I'm guessing you dont know how to do that. Maybe you should either learn how to do basic problems like this, or pay someone to do it. Your game would highly benifit from either of these, as all your problems will be fixed, quickly and properly. Also, you could make the integer unsigned, therefore changing its range from -2147483648 - 2147483648 to 0 - 4294967295. This helps by making sure it never goes negative, and/or increased the highest value. Edited January 14, 2012 by Danny696 Quote Link to comment Share on other sites More sharing options...
javance Posted January 14, 2012 Author Share Posted January 14, 2012 how do i change it cuz in my sql i have it where the big int is 255 and they can have as much as they want in the bank Quote Link to comment Share on other sites More sharing options...
javance Posted January 14, 2012 Author Share Posted January 14, 2012 Sorry, but why on earth would a player have more than 2 billion in a game? The game seems to have an economy worse than the eurozone, and the stats, maybe you should lower the gains from the gym, but I'm guessing you dont know how to do that. Maybe you should either learn how to do basic problems like this, or pay someone to do it. Your game would highly benifit from either of these, as all your problems will be fixed, quickly and properly. Also, you could make the integer unsigned, therefore changing its range from -2147483648 - 2147483648 to 0 - 4294967295. This helps by making sure it never goes negative, and/or increased the highest value. I did that so players wont be bored and they can go on forever Quote Link to comment Share on other sites More sharing options...
javance Posted January 14, 2012 Author Share Posted January 14, 2012 2147483647 is the maximum value an integer can hold. The issue might not be php, but mysql has troubles with this as the maximum value will never exceed 2147483647. Changing the data type in the database might help. Change this to bigint for larger numbers. Otherwise php doesn't seem to make much of a problem of it. It just changes ints to floats... $var = 2147483648; $var = abs((int) $var); var_dump($var); output: float(2147483648) bigint with 255 (in my sql ) will go up to a really really really large number, thats what i use stats and stuff for, and where do i put that cariable code thingy and how do i change it to bigint Quote Link to comment Share on other sites More sharing options...
javance Posted January 14, 2012 Author Share Posted January 14, 2012 nevermind, i found out, just delete (int) Quote Link to comment Share on other sites More sharing options...
Danny696 Posted January 14, 2012 Share Posted January 14, 2012 I did that so players wont be bored and they can go on forever Players do get bored when its far to easy to get money, youll have 1 or two players at the most, ive seen games where 1 or two players have 1 million in money, and they have 1000+ players online at any time, and it was nothing special. Quote Link to comment Share on other sites More sharing options...
javance Posted January 14, 2012 Author Share Posted January 14, 2012 alphacrime.com is awesome check it out username is isay123 and pass is isay123 and it has that with alot of people and its kinda hard to get cash Quote Link to comment Share on other sites More sharing options...
javance Posted January 14, 2012 Author Share Posted January 14, 2012 lmao, thats because everyone have it in there bank Quote Link to comment Share on other sites More sharing options...
Danny696 Posted January 14, 2012 Share Posted January 14, 2012 The money in circulation isnt the money in their bank. Quote Link to comment Share on other sites More sharing options...
lucky3809 Posted January 14, 2012 Share Posted January 14, 2012 alphacrime.com is awesome check it out username is isay123 and pass is isay123 and it has that with alot of people and its kinda hard to get cash IMO, not nothing special, rather it takes long to get cash or not, everything on there has been done. Nothing different then the rest of the games. Quote Link to comment Share on other sites More sharing options...
javance Posted January 14, 2012 Author Share Posted January 14, 2012 ik........ Quote Link to comment Share on other sites More sharing options...
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.