Float problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Float problem (
/showthread.php?tid=422869)
Float problem -
mrtms - 15.03.2013
I'm trying to multiply the interest by the money they have in total in the bank but for some reason it's not working. It's printing
0.00 and I'm not sure the reason of why it's doing this. Any help would be greatly appreciated.
PHP код:
new Float: InterestRate;
//Interest Rates
if(PlayerInfo[playerid][pVIP] == 0)
{
InterestRate = 0.01;
}
else if(PlayerInfo[playerid][pVIP] == 1)
{
InterestRate = 0.015;
}
else if(PlayerInfo[playerid][pVIP] == 2)
{
InterestRate = 0.02;
}
else if(PlayerInfo[playerid][pVIP] == 3)
{
InterestRate = 0.03;
}
else
{
InterestRate = 0.01;
}
printf("Interest1: %.3f", InterestRate);
Re: Float problem -
Jstylezzz - 15.03.2013
Why are you doing else if?
You can use just 'if' statements here if I'm correct..
Re: Float problem -
mrtms - 15.03.2013
It wouldn't matter because it should select through that list and assign a value, if it doesn't find it, then it should set it to 0.01. Any ideas?
Re: Float problem -
P3DRO - 15.03.2013
IF im not mistaken, you cant do Float: Interest it has to be Float:Interest, its the only thing im seing. and you are doing good using else if. In a larger code it can play a big role in performance.