Help with Bank Interest
#1

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)
                    {
                    PlayerInfo[i][pExp] = PlayerInfo[i][pExp] +5;
                    PlayerInfo[i][pPayDay] = 0;
                    PlayerInfo[i][pPayCheck] = 0;
                    PlayerInfo[i][pConnectTime] += 5;
                    PlayerInfo[i][pRPBoost] = 0;
                    }
                    else
                    {
                    PlayerInfo[i][pExp] ++;
                    PlayerInfo[i][pPayDay] = 0;
                    PlayerInfo[i][pPayCheck] = 0;
                    PlayerInfo[i][pConnectTime] += 1;
                }
                }
                else
                {
                    SendClientMessage(i, COLOR_WHITE, "{800040}Error :- {FFFFFF}You didn't contact the bank in time to recieve your paycheck [{800040}OOC{FFFFFF} : Not online for enough time]");
                }
            }
        }
    }
    return 1;
}
Reply
#2

Can someone please give me a response....
Reply
#3

"not working correctly" is a pretty vague description. It would help if you tell what isn't working.
Reply
#4

Basically, when the payday comes the place where it says "Interest Gained" it always says zero no matter how much money I put in the bank.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)