21.03.2011, 15:06
pawn Код:
public PayDayTime()
{
if(serverstartedpday == 1)
{
serverstartedpday = 0;
return 1;
}
new wstring[256];
new govtax = dini_Int("savedfiles/Other/Extra.cfg", "GovernmentTax");
for(new i = 0; i < MAX_PLAYERSEX; i++)
{
if(IsPlayerConnected(i) && AFKMode[i] == 0)
{
GameTextForPlayer(i, "~y~Payday!", 5000, 1);
new randomcheck = 125 + random(100);
new randomcheckii = 125 + random(100);
new interest = (PlayerInfo[i][pBank]/1000)*(intrate);
new bonus = PlayerInfo[i][pBonus];
SendClientMessage(i,COLOR_WHITE,"|___ BANK STATEMENT ___|");
format(wstring, sizeof(wstring), "Paycheck: $%d - Bonus: $%d", randcheck, bonus);
SendClientMessage(i, COLOR_GREY, wstring);
format(wstring, sizeof(wstring), "Balance: $%d - Interest Gained: $%d", PlayerInfo[i][pBank], interest);
SendClientMessage(i, COLOR_GREY, wstring);
format(wstring, sizeof(wstring), "Taxes: $%d", govtax);
SendClientMessage(i, COLOR_GREY, wstring);
if(PlayerInfo[i][pFaction] != 255 && Factions[PlayerInfo[i][pFaction]][fType] == 1 || PlayerInfo[i][pFaction] == 1 || PlayerInfo[i][pFaction] != 255 && Factions[PlayerInfo[i][pFaction]][fType] == 3)
{
format(wstring, sizeof(wstring), "Government paycheck: $%d", randcheckii);
SendClientMessage(i, COLOR_GREY, wstring);
}
PlayerInfo[i][pBank] += interest;
PlayerInfo[i][pBank] -= govtax;
PlayerInfo[i][pBank] += randcheck + bonus;
PlayerInfo[i][pBank] += randcheckii;
Factions[1][fBank] += govtax;
PlayerInfo[i][pPayCheck] = 0;
PlayerInfo[i][pExp]++;
PlayerInfo[i][pPlayingHours] += 1;
if(PlayerInfo[i][pTickets] >= 1)
{
PlayerInfo[i][pBank] -= PlayerInfo[i][pTickets];
Factions[0][fBank] += PlayerInfo[i][pTickets];
format(wstring, sizeof(wstring), "Unpaid tickets were paid. Totally paid: $%d", PlayerInfo[i][pTickets]);
SendClientMessage(i, COLOR_LOCALMSG, wstring);
PlayerInfo[i][pTickets] = 0;
}
SendClientMessage(i,COLOR_WHITE,"_______________________");
format(wstring, sizeof(wstring), "New balance: $%d", PlayerInfo[i][pBank]);
SendClientMessage(i,COLOR_GREY, wstring);
new nxtlevel = PlayerInfo[i][pLevel]+1;
new expamount = nxtlevel*levelexp;
if(PlayerInfo[i][pExp] < expamount)
{
format(wstring, sizeof(wstring), "%d/%d experience needed to level up, you currently have %d", expamount,expamount,PlayerInfo[i][pExp]);
SendClientMessage(i,COLOR_GREY, wstring);
}
else
{
format(wstring, sizeof(wstring), "Level up! - New Level: %d", nxtlevel);
SendClientMessage(i,COLOR_GREY, wstring);
PlayerInfo[i][pLevel]++;
PlayerInfo[i][pExp] = 0;
}
}
}
return 1;
}

