Код:
function::PayDay()
{
new pdString[128], interest, rent = 0;
foreach(Player, i)
{
if(APlayerData[i][pLogged])
{
if(APlayerData[i][pLevel] > 0)
{
if(MoneyMessage[i])
{
if(!APlayerData[i][pJailed])
{
SendClientMessage(i, COLOR_LIGHTRED, "Vocк nгo pagou sua divida e foi preso.");
GameTextForPlayer(i, "~r~Preso!", 2000, 1);
SetPlayerInterior(i, 6);
SetPlayerPos(i, 264.6288,77.5742,1001.0391);
APlayerData[i][pJailed] = 1;
ResetPlayerWeapons(i);
SetPlayerWantedLevelEx(i, 0);
WantedPoints[i] = 0;
APlayerData[i][pJailTime] = 240;
format(String, sizeof(String), "Vocк foi preso por %d segundos. Fianca: Desabilitada", APlayerData[i][pJailTime]);
SendClientMessage(i, COLOR_LIGHTBLUE, String);
}
else SendClientMessage(i, COLOR_GRAD1, " Vocк estava devendo, mas como jб estб preso, permanecerб.");
}
new key = APlayerData[i][pHouseKey];
if(key != 500)
{
rent = HouseInfo[key][hRent];
if(strcmp(PlayerName(i), HouseInfo[key][hOwner], true) == 0)
rent = 0;
else if(rent > GetPlayerMoneyEx(i))
{
APlayerData[i][pHouseKey] = 500;
SendClientMessage(i, COLOR_WHITE, "Vocк foi expulso(a).");
rent = 0;
}
HouseInfo[key][hTakings] = HouseInfo[key][hTakings] + rent;
}
if(APlayerData[i][pPayDay] >= 3)
{
new checks = random(9999)+9999;
new ebill = APlayerData[i][pLevel] * 1000;
GivePlayerMoneyEx(i, checks);
GivePlayerMoneyEx(i, -TaxValue);
new tmpintrate;
switch(APlayerData[i][pVIP])
{
case 1: tmpintrate = 12, APlayerData[i][pExp] += 2;
case 2: tmpintrate = 18, APlayerData[i][pExp] += 4;
default: tmpintrate = 6, APlayerData[i][pExp]++;
}
interest = (APlayerData[i][pBank]/1000)*(tmpintrate);
APlayerData[i][pBank] += interest;
SendClientMessage(i, COLOR_WHITE, "|_____ Recibo de Pagamento _____|");
format(pdString, sizeof(pdString), " Salбrio: R$%s Impostos: -R$%s", Comma(checks), Comma(TaxValue));
SendClientMessage(i, COLOR_GRAD1, pdString);
SalarioPlayer(i);
SendClientMessage(i, COLOR_GRAD1, " Mйdico: -$300");
if(APlayerData[i][pHouseKey] != 500 || APlayerData[i][pBizzKey] != 255)
{
format(pdString, sizeof(pdString), " Energia: -R$%s", Comma(ebill));
SendClientMessage(i, COLOR_GRAD1, pdString);
GivePlayerMoneyEx(i, -ebill);
SBizzInfo[1][sbTill] += ebill;
}
if(APlayerData[i][pFazKey] != 255)
{
format(pdString, sizeof(pdString), " Бgua: -R$%s", Comma(ebill));
SendClientMessage(i, COLOR_GRAD1, pdString);
GivePlayerMoneyEx(i, -ebill);
SBizzInfo[1][sbTill] += ebill;
}
format(pdString, sizeof(pdString), " Juros: 0.%d por cento", (tmpintrate/4));
SendClientMessage(i, COLOR_GRAD1, pdString);
format(pdString, sizeof(pdString), " Valor ganho com juros R$%s", Comma(interest));
SendClientMessage(i, COLOR_GRAD1, pdString);
SendClientMessage(i, COLOR_WHITE, "|_________________________________|");
if(APlayerData[i][pBank] > 1)
{
format(pdString, sizeof(pdString), " Novo saldo bancбrio: R$%s", Comma(APlayerData[i][pBank]));
SendClientMessage(i, COLOR_GRAD1, pdString);
}
else
{
format(pdString, sizeof(pdString), " Novo saldo bancбrio: -R$%s", Comma(APlayerData[i][pBank]));
SendClientMessage(i, COLOR_GRAD1, pdString);
}
format(pdString, sizeof(pdString), " Aluguйl: R$%s", Comma(rent));
SendClientMessage(i, COLOR_GRAD1, pdString);
GameTextForPlayer(i, "~p~PayDay~n~~w~Salario", 5000, 1);
APlayerData[i][pPayDay] = 0;
APlayerData[i][pGiftBox] = 0;
APlayerData[i][pConnectTime] += 1;
if(APlayerData[i][pJob] > 0 && APlayerData[i][pContractTime] < 5)
APlayerData[i][pContractTime]++;
}
else
{
SendClientMessage(i, COLOR_LIGHTRED, "* Vocк nгo jogou tempo suficiente para receber salбrio!");
}
}
}
}
ResetSeq();
Checkproop();
ContratoAleatorio();
return 1;
}