SA-MP Forums Archive
Need help with bank interest. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Need help with bank interest. (/showthread.php?tid=443780)



Need help with bank interest. - Bryan396 - 13.06.2013

The bank interest in my script is not working correctly for regular users and VIP users as well. If someone could please take a look at it and get back to me that would be great.

pawn Код:
//INTEREST
                    interest = (PlayerInfo[i][pAccount]/500)*(tmpintrate); //bank interest
                    PlayerInfo[i][pAccount] = account+interest; //add interest money to bank
                    //EXP
                    SendClientMessage(i, COLOR_WHITE, "|___ BANK STATEMENT ___|");
                    format(string, sizeof(string), "  Paycheck: $%d", checks);
                    SendClientMessage(i, COLOR_GRAD1, string);
                    format(string, sizeof(string), "  Income Tax: -$%d", incometax);
                    SendClientMessage(i, COLOR_GRAD1, string);
                    if(PlayerInfo[i][pPhousekey] >= 1)
                    {
                        format(string, sizeof(string), "  House Electricity Bill: -$%d", ebill1);
                        SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pPbiskey] >= 1)
                    {
                        format(string, sizeof(string), "  Business Electricity Bill: -$%d", ebill2);
                        SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    format(string, sizeof(string), "  Rent: -$%d", rent);
                    SendClientMessage(i, COLOR_GRAD1, string);
                    format(string, sizeof(string), "  Balance: $%d", account);
                    SendClientMessage(i, COLOR_GRAD1, string);
                    if(PlayerInfo[i][pDonateRank] == 0)
                    {
                        tmpintrate = tmpintrate/5;
                        format(string, sizeof(string), "  Interest rate: 2.5%d percent",tmpintrate);
                        SendClientMessage(i, COLOR_GRAD2, string);
                    }
                    else if(PlayerInfo[i][pDonateRank] == 1)
                    {
                        tmpintrate = tmpintrate/5;
                        format(string, sizeof(string), "  Interest rate: 3.0%d percent [Bronze VIP]",tmpintrate);
                        SendClientMessage(i, COLOR_GRAD2, string);
                    }
                    else if(PlayerInfo[i][pDonateRank] == 2)
                    {
                        tmpintrate = tmpintrate/5;
                        format(string, sizeof(string), "  Interest rate: 3.4%d percent [Silver VIP]",tmpintrate);
                        SendClientMessage(i, COLOR_GRAD2, string);
                    }
                    else if(PlayerInfo[i][pDonateRank] == 3)
                    {
                        tmpintrate = tmpintrate/10;
                        format(string, sizeof(string), "  Interest rate: 3.8%d percent [Gold VIP]",tmpintrate);
                        SendClientMessage(i, COLOR_GRAD2, string);
                    }
                    else if(PlayerInfo[i][pDonateRank] == 4)
                    {
                        tmpintrate = tmpintrate/10;
                        format(string, sizeof(string), "  Interest rate: 4.0%d percent [Platinium VIP]",tmpintrate);
                        SendClientMessage(i, COLOR_GRAD2, string);
                    }

                    else if(PlayerInfo[i][pDonateRank] == 5)
                    {
                        tmpintrate = tmpintrate/10;
                        format(string, sizeof(string), "  Interest rate: 4.2%d percent [VIP Moderator]",tmpintrate);
                        SendClientMessage(i, COLOR_GRAD2, string);
                    }
                    format(string, sizeof(string), "  Interest gained $%d", interest);
                    SendClientMessage(i, COLOR_GRAD3, string);
                    SendClientMessage(i, COLOR_GRAD4, "|------------------------------------------|");
                    format(string, sizeof(string), "  New Balance: $%d", PlayerInfo[i][pAccount]);
                    SendClientMessage(i, COLOR_GRAD5, string);
                    format(string, sizeof(string), "~y~PayDay~n~~w~Paycheck");
                    GameTextForPlayer(i, string, 5000, 1);
                    if(PlayerInfo[i][pRPBoost] == 1)



Re: Need help with bank interest. - Knappen - 13.06.2013

Can you put pawn tags around it? It's a bit easier to read then.

pawn Код:
text
[pawnn][/pawnn] remove one of the n's.