20.07.2016, 13:14
Hello, how do i make that it will show on the paycheck that was added to the account,
after Tax, ebill etc has been paid?
I also tried this, but it doenst work
after Tax, ebill etc has been paid?
I also tried this, but it doenst work
pawn Код:
stock PayDay(playerid)
{
new string[256];
new interest;
new oldbalance = PlayerInfo[playerid][pAccount];
if(PlayerInfo[playerid][pPayDay] >= 5)
{
Tax += TaxValue;
PlayerInfo[playerid][pAccount] -= TaxValue;
new checks = PlayerInfo[playerid][pPayCheck];
new ebill = (PlayerInfo[playerid][pAccount]/9000)*(PlayerInfo[playerid][pLevel]);
PlayerInfo[playerid][pAccount] += checks;
if(PlayerInfo[playerid][pAccount] > 0)
{
PlayerInfo[playerid][pAccount] -= ebill;
}
else
{
ebill = 0;
}
if(PlayerInfo[playerid][pDonatorLevel] > 0)
{
new bonus = PlayerInfo[playerid][pPayCheck] / 10;
checks += bonus;
}
interest = 0;
PlayerInfo[playerid][pExp]++;
PlayerInfo[playerid][pAccount] += interest;
SendClientMessage(playerid, COLOR_WHITE, "|___ BANK STATMENT ___|");
format(string, sizeof(string), " Paycheck: "COL_GREEN"$%s", Comma(checks));
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), " Income Tax: {FF6347}-$%d", TaxValue);
SendClientMessage(playerid, COLOR_GRAD1, string);
if(PlayerInfo[playerid][pHouseAccepted] == 1)
{
format(string, sizeof(string), "Electricity Bill: {FF6347}-$%s", Comma(ebill));
SendClientMessage(playerid, COLOR_GRAD1, string);
}
new storagefee;
for(new i = 1;i < PlayerInfo[playerid][pGunLockerPerk] + 1;i++)
{
if(pLockerType[playerid][i])
{
storagefee += 399 + random(201);
}
}
if(storagefee)
{
format(string, sizeof(string)," Storage Fee: {FF6347}-$%s",Comma(storagefee));
SendClientMessage(playerid,COLOR_GRAD1,string);
PlayerInfo[playerid][pAccount] -= storagefee;
}
if (PlayerInfo[playerid][pHitmanTax])
{
format(string, sizeof(string), " Hitman Tax: {FF6347}-$%s",Comma(PlayerInfo[playerid][pHitmanTax]));
SendClientMessage(playerid, COLOR_GRAD5, string);
PlayerInfo[playerid][pAccount] -= PlayerInfo[playerid][pHitmanTax];
PlayerInfo[playerid][pHitmanTax] = 0;
}
if (PlayerInfo[playerid][pSock] >= 1)
{
format(string, sizeof(string), " Poopsock Tax: {FF6347}-$%s",Comma(PlayerInfo[playerid][pSock]));
SendClientMessage(playerid, COLOR_GRAD5, string);
PlayerInfo[playerid][pAccount] -= PlayerInfo[playerid][pSock];
}
SendClientMessage(playerid, COLOR_GRAD4, "|--------------------------------------|");
format(string, sizeof(string), " Old Balance: "COL_GREEN"$%s", Comma(oldbalance));
SendClientMessage(playerid, COLOR_GRAD5, string);
format(string, sizeof(string), " Net Pay: "COL_GREEN"$%d", interest);
SendClientMessage(playerid, COLOR_GRAD5, string);
format(string, sizeof(string), " New Balance: "COL_GREEN"$%s", Comma(PlayerInfo[playerid][pAccount]));
SendClientMessage(playerid, COLOR_GRAD5, string);
format(string, sizeof(string), "~y~PayDay~n~~w~Paycheck");
GameTextForPlayer(playerid, string, 5000, 1);
PlayerInfo[playerid][pPayDay] = 0;
PlayerInfo[playerid][pPayCheck] = 0;
PlayerInfo[playerid][pConnectTime] += 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "* You haven't played long enough to obtain a PayDay.");
}
CheckReady[playerid] = 0;
return 1;
}