MMORPG

hi im going to try explain this as best as i can im making a mmorpg in php and i need help with script for the bank so donators get more intrest then avarage users the bank bit for intrest is as follows

BANK.php
$interest= $ir[‘bankmoney’]/100*2 ;
$interests=money_formatter($interest);
$balance=money_formatter($ir[‘bankmoney’]);

and i think to make a donator command its something like this

if($ir[‘donatordays’] == 0)
{
die(“This feature is for donators only.”);
}
print "

i need to know how to make a command to allow donators to have higher intrest then normal players can anyone help me or point me in the right direction ?

Hi there,

I think you want:
[php]$interest = ($ir[‘donatordays’] > 0) ? $ir[‘bankmoney’]*0.1 : $ir[‘bankmoney’]*0.02;[/php]

By the way, $var*0.02 is the same as ($var/100)2 - unless you wanted $var/(1002)?

so $interest= $ir[‘bankmoney’]/100*2 ; thats 2% interest for none donators
the snippet that u gave me how do i change it so its 6% ? and thank you for you help its much appreciated

No problem, just divide the percentage by 100 for the digit. So for 6%, 6 / 100 = 0.06

This makes the interest sum:
[php]$interest = $ir[‘bankmoney’] * 0.06 //returns 6% of $ir[‘bankmoney’] [/php]

and could you please break it down to me and explain the code thanks

dont worry got it thank you

one last question LMAO sorry honestly this will be last one where do i put it i am complete noob im not sure
i seem to have put it in like this
[php]$interest= $ir[‘bankmoney’]/100*2 ;
$interests=money_formatter($interest);
$balance=money_formatter($ir[‘bankmoney’]);

$interest = ($ir[‘donatordays’] > 0) ;$interest = $ir[‘bankmoney’] * 0.06
$interests=money_formatter($interest);
$interest = $ir[‘bankmoney’] * 0.06 [/php]
but now i know that was wrong i wanted to put it in so the average user still gets 2% interest thanks sorry

Haha, no worries.
[php]$interest= $ir[‘bankmoney’]/100*2 ;
$interests=money_formatter($interest);
$balance=money_formatter($ir[‘bankmoney’]); [/php]

Needs to become:
[php]$interest = ($ir[‘donatordays’] > 0) ? $ir[‘bankmoney’]*0.06 : $ir[‘bankmoney’]*0.02; //6% for members, 2% for non-members
$interests = money_formatter($interest);
$balance = money_formatter($ir[‘bankmoney’]); [/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service