SA-MP Forums Archive
Help with Bank Interest - 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: Help with Bank Interest (/showthread.php?tid=443786)



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)
                    {
                    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;
}



Re: Help with Bank Interest - Bryan396 - 13.06.2013

Can someone please give me a response....


Re: Help with Bank Interest - Vince - 13.06.2013

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


Re: Help with Bank Interest - Bryan396 - 13.06.2013

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.