PayDay(i) {
if(!gPlayerLogged{i}) return 1;
new
string[128],
interest,
pVIPTax,
year,
month,
day;
getdate(year, month, day);
if(PlayerInfo[i][pLevel] > 0 && (PlayerInfo[i][pTogReports] == 1 || PlayerInfo[i][pAdmin] < 2)) {
if(GetPVarType(i, "debtMsg")) {
if(GetPlayerCash(i) < 0 && PlayerInfo[i][pJailTime] < 1 && !IsACop(i) && PlayerInfo[i][pWantedLevel] < 6) {
format(string,sizeof(string),"You're in debt $%s - find a way to pay back the money or you might get in trouble!", 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 {
if(!Bank_TransferCheck(-HouseInfo[PlayerInfo[i][pRenting]][hRentFee])) return 1;
HouseInfo[PlayerInfo[i][pRenting]][hSafeMoney] += HouseInfo[PlayerInfo[i][pRenting]][hRentFee];
PlayerInfo[i][pAccount] -= HouseInfo[PlayerInfo[i][pRenting]][hRentFee];
}
}
if(PlayerInfo[i][pConnectSeconds] >= 3600) {
if(GetPVarInt(i, "pBirthday") == 1) {
PlayerInfo[i][pPayCheck] = PlayerInfo[i][pPayCheck] * 2;
}
if(GetPVarType(i, "AdvisorDuty")) {
PlayerInfo[i][pDutyHours]++;
}
if(SpecTimer) AddSpecialToken(i);
//SendClientMessage(i, COLOR_LIGHTBLUE, "You have received 100 Shop Credits!");
PlayerInfo[i][pCredits] += 10;
SendClientMessageEx(i, COLOR_WHITE, "________ BANK STATEMENT ________");
if(PlayerInfo[i][pNation] == 0)
{
if(PlayerInfo[i][pDonateRank] < 4)
{
format(string, sizeof(string), " Paycheck: $%s | SA Gov Tax: $%s (%d percent)", number_format(PlayerInfo[i][pPayCheck]), number_format((PlayerInfo[i][pPayCheck] / 100) * TaxValue), TaxValue);
if(!Bank_TransferCheck((PlayerInfo[i][pPayCheck] / 300) * TaxValue)) return 1;
PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 300) * TaxValue;
Tax += (PlayerInfo[i][pPayCheck] / 15) * TaxValue;
}
else
{
pVIPTax = TaxValue - 15;
if(pVIPTax < 0) { pVIPTax = 0; }
format(string, sizeof(string), " Paycheck: $%s | SA Gov Tax: $%s (%d percent) {FFFF00}(Platinum VIP: 15 percent off)", number_format(PlayerInfo[i][pPayCheck]), number_format((PlayerInfo[i][pPayCheck] / 100) * pVIPTax), pVIPTax);
if(!Bank_TransferCheck((PlayerInfo[i][pPayCheck] / 300) * pVIPTax)) return 1;
PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 300) * pVIPTax;
Tax += (PlayerInfo[i][pPayCheck] / 300) * pVIPTax;
}
}
else if(PlayerInfo[i][pNation] == 1)
{
if(PlayerInfo[i][pDonateRank] < 4)
{
format(string, sizeof(string), " Paycheck: $%s | NE Gov Tax: $%s (%d percent)", number_format(PlayerInfo[i][pPayCheck]), number_format((PlayerInfo[i][pPayCheck] / 100) * TRTaxValue), TRTaxValue);
if(!Bank_TransferCheck((PlayerInfo[i][pPayCheck] / 300) * TRTaxValue)) return 1;
PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 300) * TRTaxValue;
TRTax += (PlayerInfo[i][pPayCheck] / 300) * TRTaxValue;
}
else
{
pVIPTax = TRTaxValue - 15;
if(pVIPTax < 0) { pVIPTax = 0; }
format(string, sizeof(string), " Paycheck: $%s | NE Gov Tax: $%s (%d percent) {FFFF00}(Platinum VIP: 15 percent off)", number_format(PlayerInfo[i][pPayCheck]), number_format((PlayerInfo[i][pPayCheck] / 100) * pVIPTax), pVIPTax);
if(!Bank_TransferCheck((PlayerInfo[i][pPayCheck] / 300) * pVIPTax)) return 1;
PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 300) * pVIPTax;
TRTax += (PlayerInfo[i][pPayCheck] / 300) * pVIPTax;
}
}
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), " Balance: $%s | Interest rate: 0.1 percent (50k max)", number_format(PlayerInfo[i][pAccount]));
SendClientMessageEx(i, COLOR_GRAD1, string);
}
case 1: {
if(interest > 100000) interest = 100000;
format(string, sizeof(string), " Balance: $%s | Interest rate: 0.1 percent {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), " Balance: $%s | Interest rate: 0.1 percent {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), " Balance: $%s | Interest rate: 0.1 percent {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), " Balance: $%s | Interest rate: 0.1 percent {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] / 300) * 3;
Tax += (PlayerInfo[i][pPayCheck] / 300) * 3;
format(string, sizeof(string), " Taxi licensing fee (3 percent): $%s", number_format((PlayerInfo[i][pPayCheck] / 300) * 3));
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] == GROUP_TYPE_GOV)
{
new str[128];
if(PlayerInfo[i][pDonateRank] < 4) {
format(str, sizeof(str), "%s has paid $%s in tax.", GetPlayerNameEx(i), number_format((PlayerInfo[i][pPayCheck] / 300) * TaxValue));
} else {
format(str, sizeof(str), "%s has paid $%s in tax.", GetPlayerNameEx(i), number_format((PlayerInfo[i][pPayCheck] / 300) * pVIPTax));
}
GroupPayLog(iGroupID, str);
}
}
}
else if (PlayerInfo[i][pNation] == 1)
{
if(arrGroupData[iGroupID][g_iAllegiance] == 2)
{
if(arrGroupData[iGroupID][g_iGroupType] == GROUP_TYPE_GOV)
{
new str[128];
if(PlayerInfo[i][pDonateRank] < 4) {
format(str, sizeof(str), "%s has paid $%s in tax.", GetPlayerNameEx(i), number_format((PlayerInfo[i][pPayCheck] / 300) * TRTaxValue));
} else {
format(str, sizeof(str), "%s has paid $%s in tax.", GetPlayerNameEx(i), number_format((PlayerInfo[i][pPayCheck] / 300) * pVIPTax));
}
GroupPayLog(iGroupID, str);
}
}
}
}
if(!Bank_TransferCheck(-interest)) return 1;
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), " New balance: $%s | Rent paid: $%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);
SendClientMessageEx(i, COLOR_LIGHTBLUE, "As an added bonus you also have received 10 Shop credits!");
//GivePlayerCash(i, PlayerInfo[i][pPayCheck]);
GivePlayerCashEx(i, TYPE_BANK, PlayerInfo[i][pPayCheck]);
HourDedicatedPlayer(i);
/*if(month == 12 && day == 5)
{
if(++PlayerInfo[i][pFallIntoFun] == 5)
{
if(PlayerInfo[i][pReceivedPrize] == 0)
{
PlayerInfo[i][pGVIPExVoucher] += 1;
SendClientMessageEx(i, COLOR_LIGHTBLUE, "You have received a 7 day Gold VIP voucher for playing 5 hours.");
PlayerInfo[i][pReceivedPrize] = 1;
}
PlayerInfo[i][pFallIntoFun] = 0;
}
}*/
// Fall Into Fun - 100 HP every 5 paychecks
/*PlayerInfo[i][pFallIntoFun]++;
if(PlayerInfo[i][pFallIntoFun] == 5)
{
new Float: health;
GetHealth(i, health);
if(health == 100)
{
PlayerInfo[i][pFirstaid]++;
SendClientMessageEx(i, COLOR_LIGHTBLUE, "You have played for 5 hours and received a firstaid kit due to having 100 percent health already.");
PlayerInfo[i][pFallIntoFun] = 0;
}
else
{
SetHealth(i, 100.0);
SendClientMessageEx(i, COLOR_LIGHTBLUE, "You have played for 5 hours and received 100 percent HP.");
PlayerInfo[i][pFallIntoFun] = 0;
}
}*/
PayGroupMember(i);
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]]);
GivePlayerCashEx(i, TYPE_BANK, 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~Paycheck", 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;
}
// Auto Levels
if(PlayerInfo[i][pAdmin] < 2) LevelCheck(i);
// Zombie Halloween
if(month == 10 && day == 30)
{
if(PlayerInfo[i][pFallIntoFun] < 4)
{
PlayerInfo[i][pFallIntoFun]++;
}
else {
PlayerInfo[i][pFallIntoFun] = 0;
PlayerInfo[i][pVials] += 1;
}
}
/*
if((month == 12 && day == 24) || (month == 10 && day == 31))
{
if(PlayerInfo[i][pTrickortreat] > 0)
{
PlayerInfo[i][pTrickortreat]--;
}
}*/
if(month == 10 && (day == 29 || day == 30 || day == 31))
{
++PlayerInfo[i][pTrickortreat];
if(PlayerInfo[i][pTrickortreat] == 15) {
GiveHtoy(i, 2590, "Scythe");
}
if(PlayerInfo[i][pTrickortreat] == 30) {
GiveHtoy(i, 2907, "Zombie Torso");
}
}
if(month == 5 && day == 25) //Memorial Day 2015
{
if(++PlayerInfo[i][pTrickortreat] == 3)
SendClientMessageEx(i, -1, "You have been given 1 Double EXP Token for playing 3 hours!"), PlayerInfo[i][pEXPToken]++, PlayerInfo[i][pTrickortreat] = 0;
}
//Weekday Madness for Fall Into Fun event; re-using Trickortreat variable to check connected time
/*if(month == 10 && (day == 9 || day == 16))
{
PlayerInfo[i][pRewardDrawChance] += 2;
}
else if(month == 10 && day == 19)
{
PlayerInfo[i][pRewardDrawChance] += 3;
}
else PlayerInfo[i][pRewardDrawChance]++;
if(PlayerInfo[i][pDonateRank] >= 3 && month == 10 && day == 13)
{
PlayerInfo[i][pRewardDrawChance] += 3;
}*/
Misc_Save();
if(iRewardPlay) {
PlayerInfo[i][pRewardHours]++;
if(floatround(PlayerInfo[i][pRewardHours]) % 16 == 0) {
PlayerInfo[i][pGoldBoxTokens]++;
SendClientMessage(i, COLOR_LIGHTBLUE, "You have received 1 Gold Giftbox token! #FallIntoFun");
SendClientMessage(i, COLOR_LIGHTBLUE, "You have received 500 Shop Credits!");
PlayerInfo[i][pCredits] += 500;
}
format(string, sizeof(string), "You currently have %d Reward Hours, please check /rewards for more information.", floatround(PlayerInfo[i][pRewardHours]));
SendClientMessageEx(i, COLOR_YELLOW, string);
}
if(PlayerInfo[i][pDoubleEXP] > 0) {
PlayerInfo[i][pDoubleEXP]--;
format(string, sizeof(string), "You have gained 2 respect points instead of 1. You have %d hours left on the Double EXP token.", PlayerInfo[i][pDoubleEXP]);
SendClientMessageEx(i, COLOR_YELLOW, string);
PlayerInfo[i][pExp] += 2;
}
else PlayerInfo[i][pExp]++;
if(GetPVarInt(i, "pBirthday") == 1) {
SendClientMessageEx(i, COLOR_YELLOW, "Gold VIP: You have received x2 paycheck as a birthday gift!");
}
if(PlayerInfo[i][pWRestricted] > 0 && --PlayerInfo[i][pWRestricted] == 0) {
SendClientMessageEx(i, COLOR_LIGHTRED, "Your weapons are no longer restricted!");
}
if(PlayerInfo[i][pShopNotice] > 0) PlayerInfo[i][pShopNotice]--;
if(ShopReminder == 1 && PlayerInfo[i][pShopNotice] == 0)
{
PlayerInfo[i][pShopCounter]++;
PlayerInfo[i][mShopCounter]++;
/*if(PlayerInfo[i][pLevel] <= 5 && PlayerInfo[i][mShopCounter] == 3 || (PlayerInfo[i][pLevel] > 5 && PlayerInfo[i][mShopCounter] >= 4 && PlayerInfo[i][pCredits] >= 10))
{
PlayerTextDrawSetString(i, MicroNotice[i], ShopMsg[PlayerInfo[i][mNotice]]);
PlayerTextDrawShow(i, MicroNotice[i]);
SetTimerEx("HidePlayerTextDraw", 10000, false, "ii", i, _:MicroNotice[i]);
if(++PlayerInfo[i][mNotice] > 3) PlayerInfo[i][mNotice] = 0;
PlayerInfo[i][mShopCounter] = 0;
}
if(PlayerInfo[i][pLevel] <= 5 && PlayerInfo[i][pShopCounter] == 5 || PlayerInfo[i][pLevel] > 5 && PlayerInfo[i][pShopCounter] == 10)
{
format(string, sizeof(string), "Hey check this out, type: ~y~/nggshop");
if(PlayerInfo[i][pConnectHours] >= 50)
{
strcat(string, "~w~~n~To disable this notice for 24 hours, type: ~y~/togshopnotice");
}
PlayerInfo[i][pShopCounter] = 0;
PlayerTextDrawSetString(i, ShopNotice[i], string);
PlayerTextDrawShow(i, ShopNotice[i]);
SetTimerEx("HidePlayerTextDraw", 10000, false, "ii", i, _:ShopNotice[i]);
}*/
}
if(FIFEnabled == 1)
{
FIFInfo[i][FIFHours] += 1;
if((FIFInfo[i][FIFHours] % 3) == 0)
{
if(FIFGThurs == 1)
{
GThursChances += 1;
if(GThursChances == 23)
{
PlayerInfo[i][pGVIPVoucher] += 1;
SendClientMessageEx(i, COLOR_WHITE, "You have won a 1 Month Gold VIP Voucher for Fall Into Fun! To claim it, type /myvouchers.");
GThursChances = 0;
format(string, sizeof(string), "%s(%d) won a 1 Month GVIP Voucher", GetPlayerNameEx(i), GetPlayerSQLId(i));
Log("logs/fif.log", string);
}
}
if(FIFGP3 == 1 && PlayerInfo[i][pDonateRank] >= 3)
{
FIFInfo[i][FIFChances] += 3;
format(string,sizeof(string), "You have earned 3 FIF Chances! You now have %d chances!", FIFInfo[i][FIFChances]);
SendClientMessageEx(i, COLOR_WHITE, string);
format(string, sizeof(string), "%s(%d) won 3 FIF Chances", GetPlayerNameEx(i), GetPlayerSQLId(i));
Log("logs/fif.log", string);
}
else
{
switch(FIFType)
{
case 1:
{
FIFInfo[i][FIFChances] += 1;
format(string,sizeof(string), "You have earned 1 FIF Chance! You now have %d chances!", FIFInfo[i][FIFChances]);
SendClientMessageEx(i, COLOR_WHITE, string);
format(string, sizeof(string), "%s(%d) won 1 FIF Chance.", GetPlayerNameEx(i), GetPlayerSQLId(i));
Log("logs/fif.log", string);
}
case 2:
{
FIFInfo[i][FIFChances] += 2;
format(string,sizeof(string), "You have earned 2 FIF Chance's! You now have %d chances!", FIFInfo[i][FIFChances]);
SendClientMessageEx(i, COLOR_WHITE, string);
format(string, sizeof(string), "%s(%d) won 2 FIF Chances.", GetPlayerNameEx(i), GetPlayerSQLId(i));
Log("logs/fif.log", string);
}
case 3:
{
FIFInfo[i][FIFChances] += 3;
format(string,sizeof(string), "You have earned 3 FIF Chance's! You now have %d chances!", FIFInfo[i][FIFChances]);
SendClientMessageEx(i, COLOR_WHITE, string);
format(string, sizeof(string), "%s(%d) won 3 FIF Chances.", GetPlayerNameEx(i), GetPlayerSQLId(i));
Log("logs/fif.log", string);
}
}
}
}
if(FIFTimeWarrior == 1)
{
if(FIFInfo[i][FIFHours] % 28 == 0)
{
PlayerInfo[i][pGoldBoxTokens] += 1;
SendClientMessageEx(i, COLOR_WHITE, "You have won a Gold Box Token for Fall Into Fun! To claim it, type /getrewardgift.");
format(string, sizeof(string), "%s(%d) won a Gold Box Token", GetPlayerNameEx(i), GetPlayerSQLId(i));
Log("logs/fif.log", string);
}
}
g_mysql_SaveFIF(i);
}
if(month == 4 && (day == 25 || day == 26)) // NGG B-Day 2015
{
SendClientMessageEx(i, -1, "You have earned 3 event tokens for playing 1 hour! Use /inv to view your total token amount.");
PlayerInfo[i][pEventTokens] += 3;
}
CallLocalFunction("InactivityCounter", "i", i);
}
else SendClientMessageEx(i, COLOR_LIGHTRED, "* You haven't played long enough to obtain a paycheck.");
}
if (GetPVarType(i, "UnreadMails") && HasMailbox(i))
{
SendClientMessageEx(i, COLOR_YELLOW, "You have unread items in your mailbox");
}
return 1;
}
GivePlayerCashEx(i, TYPE_BANK, PlayerInfo[i][pPayCheck]);
|
if(GetPVarInt(i, "pBirthday") == 1) { PlayerInfo[i][pPayCheck] = PlayerInfo[i][pPayCheck] * 2; } |
|
if(GetPVarInt(i, "pBirthday") == 1) { new paycheck = 1000; PlayerInfo[i][pPayCheck] = paycheck + random(500); } |