Zarath wrote:
hmm, the page crashes everytime I try to put in a large number...
I do not have this problem. I've tried an extremely huge number and I get the results I created. "You can only take out a maximum of $500 bucks at any one time."
zarath wrote:
It doesn't seem to limit me (I've now got over 1500 in loans).
Not sure what you did.. but I went into the 'test' account and there was a total of $1200 in savings account. I tried to take out a $200 loan and it stopped me by saying "You already have enough drunk bucks in your account." (which I wanted it to do this. That way you can't keep taking out loans.)
zarath wrote:
A couple of problems, you have the limits on in bank and in hand, if it = over 1000, it stops them loaning anymore... people can just spend it, give it away, then loan more. Here's the major problem, people can create an alternate account, loan 4534534534 from the bank then give it to someone else and never use the character again.
yes I'm aware of this. I just wanted to get the base code out first to see if it will work or not. I'm really not sure how to counter act this. I'm still new to php.
zarath wrote:
Solution for this?
Add another row, keep the loaned out amount in it, when someone goes to donate, you'll need to edit the userpointscp.php and make it check the userpoints to loaned amount, if it drops it below the loaned amount it will have to error.
I'll have to look into this.
zarath wrote:
How do you have the interest charged on the loans? Using the same Loop I have on interest backwards?
This is what I have... could you look it over and make a comment.
Code: Select all
$loan = round($loan);
if ((!is_numeric($loan)) || ($loan < 1)) { message_die(GENERAL_MESSAGE, 'Invalid Loan Amount!'); }
if ($loan > 500) (message_die(GENERAL_MESSAGE, 'The maximum takeout loan is $500 '.$bankinfo[7].' at any one time.'));
$loancharge = round($loan / 100 * $bankinfo[11]);
if ($loan > $row[holding]) { message_die(GENERAL_MESSAGE, 'You don\'t have enough '.$bankinfo[7].' in the bank to cover your loan request!'); }
if ($urow[user_points] >= 1000) (message_die(GENERAL_MESSAGE, 'Your loan for '.$bankinfo[7].' is denied. You already have enough '.$bankinfo[7].' in hand.'));
if ($row[holding]>= 1000) (message_die(GENERAL_MESSAGE, 'Your loan for '.$bankinfo[7].' is denied. You already have enough '.$bankinfo[7].' in your account.'));
$newbalance = $row[holding] + $loan - $loancharge;
$newpoints = $urow[user_points];
zarath wrote:
Also, a field to display how much you've loaned out would be nice.
It's coming along nicely though
Zarath... thanks for your inputs! I'm actually having fun with this while learning.