Jump to content

Interest gained cap?


Recommended Posts

I wish to set a cap on the interest gained in anyone day. Thus instead of letting users money rapidly go out of control this method will create a bottle neck and stop game money econamy going mentle.Money will rise however not to the speed of going out of control. Im suspecting this is the code to change - $db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney/100*7) where cybermoney>0"); I know this is just 1 bank and the other would have to be changed but just looking for some help from someone who knows what there doing. Dont fancy wrecking my cron. Thx in advance for any help.

This is my daily cron as it is now.

$db->query("DELETE FROM fedjail WHERE fed_days=0");

$db->query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0");

$db->query("UPDATE users SET daysold=daysold+1, boxes_opened=0");

$db->query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0");

$db->query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0");

$db->query("UPDATE users SET cdays=cdays-1 WHERE course > 0");

$db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney>0");

$db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney/100*7) where cybermoney>0");

$db->query("UPDATE users SET donatormoney=donatormoney+(donatormoney/100*10) where donatormoney>0");

$db->query("UPDATE users set gympass=gympass-1 WHERE gympass>0");

$q=$db->query("SELECT * FROM users WHERE cdays=0 AND course > 0");

Link to comment
Share on other sites

Re: Interest gained cap?

Thx for the reply however is there a way to get this to pay a max interest no matter what peoples bank amount is. As that mods stands when they pass that amount of money in the bank they get nothing. Id like it to be capped out. Alittle like when you do a deposit you pay like 15% fee but it never takes over say 3000$. Id like this to be done for interest. So like 10% interest but max interest gain perday is like 100 Million$. ?????

Link to comment
Share on other sites

Re: Interest gained cap?

Okay how about this.

Lets say you have an interest rate of 4%. Lets say you want Max Interest of 100,000.

Therefore, your limiting Bank roll is 2,500,000.


$db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney/100*7) where cybermoney > 0 and cybermoney <= 2500000");
$db->query("UPDATE users SET cybermoney=cybermoney+100000 where cybermoney > 2500000");

Link to comment
Share on other sites

  • 2 weeks later...

Re: Interest gained cap?

Also you could make it so there is a cap and you can't put anymore in but you still get intrest on it:

mysql_query("UPDATE users SET bankmoney=bankmoney*1.02 WHERE bankmoney > 0",$c) or die(mysql_error());

$rfr=mysql_query("SELECT * FROM users WHERE bankmoney>1000000000",$c) or die(mysql_error());





mysql_query("UPDATE users SET bankmoney=1000000000 WHERE userid=$userid",$c) or die(mysql_error());

mysql_query("UPDATE users SET money=money+$moneyover WHERE userid=$userid",$c) or die(mysql_error());


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.

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...