19.09.2017, 07:35
Код:
PayDay(i) { new string[128], interest, year, month, day; getdate(year, month, day); if(PlayerInfo[i][pLevel] > 0) { if(GetPVarType(i, "debtMsg")) { if(GetPlayerCash(i) < 0 && PlayerInfo[i][pJailTime] < 1 && !IsACop(i) && PlayerInfo[i][pWantedLevel] < 6) { format(string,sizeof(string),"Ban dang no $%s - Hay tмm cбch tra no neu khong se gap rac roi!", number_format(GetPlayerCash(i))); SendClientMessageEx(i, COLOR_LIGHTRED, string); } else DeletePVar(i, "debtMsg"); } if(0 <= PlayerInfo[i][pRenting] < sizeof HouseInfo) { if(HouseInfo[PlayerInfo[i][pRenting]][hRentFee] > PlayerInfo[i][pAccount]) { PlayerInfo[i][pRenting] = INVALID_HOUSE_ID; SendClientMessageEx(i, COLOR_WHITE, "You have been evicted from your residence for failing to pay rent fees."); } else { HouseInfo[PlayerInfo[i][pRenting]][hSafeMoney] += HouseInfo[PlayerInfo[i][pRenting]][hRentFee]; PlayerInfo[i][pAccount] -= HouseInfo[PlayerInfo[i][pRenting]][hRentFee]; } } if(GetPVarType(i, "AdvisorDuty")) { PlayerInfo[i][pDutyHours]++; } if(SpecTimer) AddSpecialToken(i); SendClientMessageEx(i, COLOR_WHITE, "________ NGAN HANG ________"); if(PlayerInfo[i][pNation] == 0) { format(string, sizeof(string), " Luong: $%s | Thue: $%s (%d percent)", number_format(PlayerInfo[i][pPayCheck]), number_format((PlayerInfo[i][pPayCheck] / 100) * TaxValue), TaxValue); PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 100) * TaxValue; Tax += (PlayerInfo[i][pPayCheck] / 100) * TaxValue; } else if(PlayerInfo[i][pNation] == 1) { format(string, sizeof(string), " Luong: $%s | Thue: $%s (%d percent)", number_format(PlayerInfo[i][pPayCheck]), number_format((PlayerInfo[i][pPayCheck] / 100) * TRTaxValue), TRTaxValue); PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 100) * TRTaxValue; TRTax += (PlayerInfo[i][pPayCheck] / 100) * TRTaxValue; } SendClientMessageEx(i, COLOR_GRAD1, string); interest = (PlayerInfo[i][pAccount] + 1) / 1000; switch(PlayerInfo[i][pDonateRank]) { case 0: { if(interest > 50000) interest = 50000; format(string, sizeof(string), " So du: $%s | Interest rate: 0.1 phan tram (50k max)", number_format(PlayerInfo[i][pAccount])); SendClientMessageEx(i, COLOR_GRAD1, string); } case 1: { if(interest > 100000) interest = 100000; format(string, sizeof(string), " So du: $%s | Interest rate: 0.1 phan tram {FFFF00}(Bronze VIP: 100k max)", number_format(PlayerInfo[i][pAccount])); SendClientMessageEx(i, COLOR_GRAD1, string); } case 2: { if(interest > 150000) interest = 150000; format(string, sizeof(string), " So du: $%s | Interest rate: 0.1 phan tram {FFFF00}(Silver VIP: 150k max)", number_format(PlayerInfo[i][pAccount])); SendClientMessageEx(i, COLOR_GRAD1, string); } case 3: { if(interest > 200000) interest = 200000; format(string, sizeof(string), " So du: $%s | Interest rate: 0.1 phan tram {FFFF00}(Gold VIP: 200k max)", number_format(PlayerInfo[i][pAccount])); SendClientMessageEx(i, COLOR_GRAD1, string); } case 4, 5: { if(interest > 250000) interest = 250000; format(string, sizeof(string), " So du: $%s | Interest rate: 0.1 phan tram {FFFF00}(Platinum VIP: 250k max)", number_format(PlayerInfo[i][pAccount])); SendClientMessageEx(i, COLOR_GRAD1, string); } } if(PlayerInfo[i][pTaxiLicense] == 1) { PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 100) * 5; Tax += (PlayerInfo[i][pPayCheck] / 100) * 5; format(string, sizeof(string), " Taxi licensing fee (5 percent): $%s", number_format((PlayerInfo[i][pPayCheck] / 100) * 5)); SendClientMessageEx(i, COLOR_GRAD2, string); } for(new iGroupID; iGroupID < MAX_GROUPS; iGroupID++) { if(PlayerInfo[i][pNation] == 0) { if(arrGroupData[iGroupID][g_iAllegiance] == 1) { if(arrGroupData[iGroupID][g_iGroupType] == 5) { new str[128], file[32]; format(str, sizeof(str), "%s Da tra $%s vаo thue.", GetPlayerNameEx(i), number_format((PlayerInfo[i][pPayCheck] / 100) * TaxValue)); format(file, sizeof(file), "grouppay/%d/%d-%d-%d.log", iGroupID, month, day, year); Log(file, str); } } } else if (PlayerInfo[i][pNation] == 1) { if(arrGroupData[iGroupID][g_iAllegiance] == 2) { if(arrGroupData[iGroupID][g_iGroupType] == 5) { new str[128], file[32]; format(str, sizeof(str), "%s Da tra $%s vаo thue.", GetPlayerNameEx(i), number_format((PlayerInfo[i][pPayCheck] / 100) * TaxValue)); format(file, sizeof(file), "grouppay/%d/%d-%d-%d.log", iGroupID, month, day, year); Log(file, str); } } } } PlayerInfo[i][pAccount] += interest; format(string, sizeof(string), " Interest gained: $%s", number_format(interest)); SendClientMessageEx(i, COLOR_GRAD3, string); SendClientMessageEx(i, COLOR_GRAD4, "______________________________________"); format(string, sizeof(string), " So du moi: $%s | Tien thue: $%s", number_format(PlayerInfo[i][pAccount]), number_format((0 <= PlayerInfo[i][pRenting] < sizeof HouseInfo) ? (HouseInfo[PlayerInfo[i][pRenting]][hRentFee]) : (0))); SendClientMessageEx(i, COLOR_GRAD5, string); GivePlayerCash(i, PlayerInfo[i][pPayCheck]); new iGroupID = PlayerInfo[i][pMember], iRank = PlayerInfo[i][pRank]; if((0 <= iGroupID < MAX_GROUPS) && 0 <= iRank <= 9 && arrGroupData[iGroupID][g_iPaycheck][iRank] > 0) { if(arrGroupData[iGroupID][g_iAllegiance] == 1) { if(Tax > 0) { Tax -= arrGroupData[iGroupID][g_iPaycheck][iRank]; GivePlayerCash(i, arrGroupData[iGroupID][g_iPaycheck][iRank]); format(string,sizeof(string)," SA Government pay: $%s", number_format(arrGroupData[iGroupID][g_iPaycheck][iRank])); SendClientMessageEx(i, COLOR_GRAD2, string); for(new z; z < MAX_GROUPS; z++) { if(arrGroupData[z][g_iAllegiance] == 1) { if(arrGroupData[z][g_iGroupType] == 5) { new str[128], file[32]; format(str, sizeof(str), "%s has been paid $%s in government pay.", GetPlayerNameEx(i), number_format(arrGroupData[iGroupID][g_iPaycheck][iRank])); format(file, sizeof(file), "grouppay/%d/%d-%d-%d.log", z, month, day, year); Log(file, str); break; } } } } else SendClientMessageEx(i, COLOR_RED, "The SA government is in debt; no money is available for pay."); } else if(arrGroupData[iGroupID][g_iAllegiance] == 2) { if(TRTax > 0) { TRTax -= arrGroupData[iGroupID][g_iPaycheck][iRank]; GivePlayerCash(i, arrGroupData[iGroupID][g_iPaycheck][iRank]); format(string,sizeof(string)," TR Government pay: $%s", number_format(arrGroupData[iGroupID][g_iPaycheck][iRank])); SendClientMessageEx(i, COLOR_GRAD2, string); for(new z; z < MAX_GROUPS; z++) { if(arrGroupData[z][g_iAllegiance] == 2) { if(arrGroupData[z][g_iGroupType] == 5) { new str[128], file[32]; format(str, sizeof(str), "%s has been paid $%s in government pay.", GetPlayerNameEx(i), number_format(arrGroupData[iGroupID][g_iPaycheck][iRank])); format(file, sizeof(file), "grouppay/%d/%d-%d-%d.log", z, month, day, year); Log(file, str); break; } } } } else SendClientMessageEx(i, COLOR_RED, "The TR government is in debt; no money is available for pay."); } } if (PlayerInfo[i][pBusiness] != INVALID_BUSINESS_ID) { if (Businesses[PlayerInfo[i][pBusiness]][bAutoPay] && PlayerInfo[i][pBusinessRank] >= 0 && PlayerInfo[i][pBusinessRank] < 5) { if (Businesses[PlayerInfo[i][pBusiness]][bSafeBalance] < Businesses[PlayerInfo[i][pBusiness]][bRankPay][PlayerInfo[i][pBusinessRank]]) { SendClientMessageEx(i,COLOR_RED,"Business doesn't have enough cash for your pay."); } else { GivePlayerCash(i, Businesses[PlayerInfo[i][pBusiness]][bRankPay][PlayerInfo[i][pBusinessRank]]); Businesses[PlayerInfo[i][pBusiness]][bSafeBalance] -= Businesses[PlayerInfo[i][pBusiness]][bRankPay][PlayerInfo[i][pBusinessRank]]; SaveBusiness(PlayerInfo[i][pBusiness]); format(string,sizeof(string)," Business pay: $%s", number_format(Businesses[PlayerInfo[i][pBusiness]][bRankPay][PlayerInfo[i][pBusinessRank]])); SendClientMessageEx(i, COLOR_GRAD2, string); } } } GameTextForPlayer(i, "~y~PayDay~n~~w~Nhan luong", 5000, 1); //SendAudioToPlayer(i, 63, 100); PlayerInfo[i][pConnectSeconds] = 0; PlayerInfo[i][pPayCheck] = 0; if(++PlayerInfo[i][pConnectHours] == 2) { SendClientMessageEx(i, COLOR_LIGHTRED, "You may now possess/use weapons!"); } if(PlayerInfo[i][pDonateRank] > 0 && ++PlayerInfo[i][pPayDayHad] >= 5) { PlayerInfo[i][pExp]++; PlayerInfo[i][pPayDayHad] = 0; } Misc_Save(); if(iRewardPlay) { PlayerInfo[i][pRewardHours]++; if(floatround(PlayerInfo[i][pRewardHours]) % 16 == 0) { } format(string, sizeof(string), "Ban dang co %d Reward Hours, Su dung /rewards De biet them chi tiet.", floatround(PlayerInfo[i][pRewardHours])); SendClientMessageEx(i, COLOR_YELLOW, string); } if(PlayerInfo[i][pWRestricted] > 0 && --PlayerInfo[i][pWRestricted] == 0) { SendClientMessageEx(i, COLOR_LIGHTRED, "Your weapons are no longer restricted!"); } if(PlayerInfo[i][pLanhLuong]>0) { format(string,sizeof(string),"[!]Ban co the lanh luong them %d lan",PlayerInfo[i][pLanhLuong]); SendClientMessageEx(i, COLOR_YELLOW, string); PlayerInfo[i][pLanhLuong]-=1; } if(PlayerInfo[i][pShopNotice] > 0) PlayerInfo[i][pShopNotice]--; if(ShopReminder == 1 && PlayerInfo[i][pShopNotice] == 0) { PlayerInfo[i][pShopCounter]++; if(PlayerInfo[i][pLevel] <= 5 && PlayerInfo[i][pShopCounter] == 5 || PlayerInfo[i][pLevel] > 5 && PlayerInfo[i][pShopCounter] == 10) { format(string, sizeof(string), "Hay check shop ooc, Su dung: ~y~/shopcoin"); if(PlayerInfo[i][pConnectHours] >= 50) { strcat(string, "~w~~n~De tat thong bбo, su dung: ~y~/togshopnotice"); } PlayerInfo[i][pShopCounter] = 0; PlayerTextDrawSetString(i, ShopNotice[i], string); PlayerTextDrawShow(i, ShopNotice[i]); SetTimerEx("HidePlayerTextDraw", 10000, false, "ii", i, _:ShopNotice[i]); } } } return 1; }
Код:
if(GetPVarType(i, "AdvisorDuty")) { PlayerInfo[i][pDutyHours]++; }
Код:
} return 1; }