02.09.2011, 08:00
Hello again, I made a bank interest sistem to give you 2% of your total stored in bank money every payday, but for example if I have stored in bank 100.000$ and on payday I recieve from interest let's say 1040$ it will only deposit 1000$ and the other 40$ not, why is that ? Here is the script :
If you need something else just let me know. Thanks in advance.
pawn Код:
new string[128];
for(new i=0; i<MAX_SLOTS; i++)
{
//if(IsPlayerConnected(i))
//{
format(string, sizeof(string), "_______< Bank of %s >________", GAMEMODE_MAP);
SendClientMessage(i, COLOR_BLUE, string);
format(string, sizeof(string), " Level: %d, Exp: %d", PlayerInfo[i][pLevel], PlayerInfo[i][pExp]);
SendClientMessage(i, COLOR_GREY, string);
format(string, sizeof(string), " Balance: %d$", PlayerInfo[i][pBank]);
SendClientMessage(i, COLOR_GREY, string);
format(string, sizeof(string), " Drugs: %d gram.", PlayerInfo[i][pDrugs]);
SendClientMessage(i, COLOR_GREY, string);
PlayerInfo[i][pExp] ++;
if(PlayerInfo[i][pVip] == 1){PlayerInfo[i][pExp] ++;} // 1 Extra exp for vips.
if(gTeam[i] != TEAM_COP && gTeam[i] != TEAM_ARMY)
{
PlayerInfo[i][pDrugs] += 2;
if(PlayerInfo[i][pVip] == 1){PlayerInfo[i][pDrugs] += 3;}
} // 1 Extra gram drugs for vips.
PlayerInfo[i][pBank] = PlayerInfo[i][pBank]+PlayerInfo[i][pBank]*2/100;
if(PlayerInfo[i][pExp] >= PlayerInfo[i][pLevel])
{
PlayerInfo[i][pExp] = 0;
PlayerInfo[i][pLevel] ++;
}
SendClientMessage(i, COLOR_WHITE, "|--------------------------------------------------|");
format(string, sizeof(string), " New Level: %d, New Exp: %d", PlayerInfo[i][pLevel], PlayerInfo[i][pExp]);
SendClientMessage(i, COLOR_GREY, string);
format(string, sizeof(string), " New Balance: %d$", PlayerInfo[i][pBank]);
SendClientMessage(i, COLOR_GREY, string);
format(string, sizeof(string), " Bank Interest: 2/100", PlayerInfo[i][pBank]);
SendClientMessage(i, COLOR_GREY, string);
format(string, sizeof(string), " New Drugs: %d gram.", PlayerInfo[i][pDrugs]);
SendClientMessage(i, COLOR_GREY, string);
SendClientMessage(i, COLOR_BLUE, "________________________________");
format(string, sizeof(string), "~b~PayDay~n~~w~Paycheck ~n~~g~%d$", PlayerInfo[i][pBank]*2/100);
GameTextForPlayer(i, string, 5000, 1);
UpdatePlayer(i); // Save the stats of the player.
//}
}