Advertisement
Guest User

Untitled

a guest
Oct 21st, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.46 KB | None | 0 0
  1. PayDay(i) {
  2. new
  3. string[128],
  4. interest,
  5. year,
  6. month,
  7. day;
  8.  
  9. getdate(year, month, day);
  10.  
  11. if(PlayerInfo[i][pLevel] > 0) {
  12. if(GetPVarType(i, "debtMsg")) {
  13. if(GetPlayerCash(i) < 0 && PlayerInfo[i][pJailTime] < 1 && !IsACop(i) && PlayerInfo[i][pWantedLevel] < 6) {
  14. 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)));
  15. SendClientMessageEx(i, COLOR_LIGHTRED, string);
  16. }
  17. else DeletePVar(i, "debtMsg");
  18. }
  19.  
  20. if(0 <= PlayerInfo[i][pRenting] < sizeof HouseInfo) {
  21. if(HouseInfo[PlayerInfo[i][pRenting]][hRentFee] > PlayerInfo[i][pAccount]) {
  22. PlayerInfo[i][pRenting] = INVALID_HOUSE_ID;
  23. SendClientMessageEx(i, COLOR_WHITE, "You have been evicted from your residence for failing to pay rent fees.");
  24. }
  25. else {
  26. HouseInfo[PlayerInfo[i][pRenting]][hSafeMoney] += HouseInfo[PlayerInfo[i][pRenting]][hRentFee];
  27. PlayerInfo[i][pAccount] -= HouseInfo[PlayerInfo[i][pRenting]][hRentFee];
  28. }
  29. }
  30. if(PlayerInfo[i][pConnectSeconds] >= 3600) {
  31. if(GetPVarType(i, "AdvisorDuty")) {
  32. PlayerInfo[i][pDutyHours]++;
  33. }
  34. if(SpecTimer) AddSpecialToken(i);
  35. SendClientMessageEx(i, COLOR_WHITE, "________ BANK STATEMENT ________");
  36. if(PlayerInfo[i][pNation] == 0)
  37. {
  38. 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);
  39. PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 100) * TaxValue;
  40. Tax += (PlayerInfo[i][pPayCheck] / 100) * TaxValue;
  41. }
  42. else if(PlayerInfo[i][pNation] == 1)
  43. {
  44. format(string, sizeof(string), " Paycheck: $%s | TR Gov Tax: $%s (%d percent)", number_format(PlayerInfo[i][pPayCheck]), number_format((PlayerInfo[i][pPayCheck] / 100) * TRTaxValue), TRTaxValue);
  45. PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 100) * TRTaxValue;
  46. TRTax += (PlayerInfo[i][pPayCheck] / 100) * TRTaxValue;
  47. }
  48. SendClientMessageEx(i, COLOR_GRAD1, string);
  49. interest = (PlayerInfo[i][pAccount] + 1) / 1000;
  50.  
  51. switch(PlayerInfo[i][pDonateRank]) {
  52. case 0: {
  53. if(interest > 50000) interest = 50000;
  54. format(string, sizeof(string), " Balance: $%s | Interest rate: 0.1 percent (50k max)", number_format(PlayerInfo[i][pAccount]));
  55. SendClientMessageEx(i, COLOR_GRAD1, string);
  56. }
  57. case 1: {
  58. if(interest > 100000) interest = 100000;
  59. format(string, sizeof(string), " Balance: $%s | Interest rate: 0.1 percent {FFFF00}(Bronze VIP: 100k max)", number_format(PlayerInfo[i][pAccount]));
  60. SendClientMessageEx(i, COLOR_GRAD1, string);
  61. }
  62. case 2: {
  63. if(interest > 150000) interest = 150000;
  64. format(string, sizeof(string), " Balance: $%s | Interest rate: 0.1 percent {FFFF00}(Silver VIP: 150k max)", number_format(PlayerInfo[i][pAccount]));
  65. SendClientMessageEx(i, COLOR_GRAD1, string);
  66. }
  67. case 3: {
  68. if(interest > 200000) interest = 200000;
  69. format(string, sizeof(string), " Balance: $%s | Interest rate: 0.1 percent {FFFF00}(Gold VIP: 200k max)", number_format(PlayerInfo[i][pAccount]));
  70. SendClientMessageEx(i, COLOR_GRAD1, string);
  71. }
  72. case 4, 5: {
  73. if(interest > 250000) interest = 250000;
  74. format(string, sizeof(string), " Balance: $%s | Interest rate: 0.1 percent {FFFF00}(Platinum VIP: 250k max)", number_format(PlayerInfo[i][pAccount]));
  75. SendClientMessageEx(i, COLOR_GRAD1, string);
  76. }
  77. }
  78. if(PlayerInfo[i][pTaxiLicense] == 1) {
  79. PlayerInfo[i][pAccount] -= (PlayerInfo[i][pPayCheck] / 100) * 5;
  80. Tax += (PlayerInfo[i][pPayCheck] / 100) * 5;
  81. format(string, sizeof(string), " Taxi licensing fee (5 percent): $%s", number_format((PlayerInfo[i][pPayCheck] / 100) * 5));
  82. SendClientMessageEx(i, COLOR_GRAD2, string);
  83. }
  84. for(new iGroupID; iGroupID < MAX_GROUPS; iGroupID++)
  85. {
  86. if(PlayerInfo[i][pNation] == 0)
  87. {
  88. if(arrGroupData[iGroupID][g_iAllegiance] == 1)
  89. {
  90. if(arrGroupData[iGroupID][g_iGroupType] == 5)
  91. {
  92. new str[128], file[32];
  93. format(str, sizeof(str), "%s has paid $%s in tax.", GetPlayerNameEx(i), number_format((PlayerInfo[i][pPayCheck] / 100) * TaxValue));
  94. format(file, sizeof(file), "grouppay/%d/%d-%d-%d.log", iGroupID, month, day, year);
  95. Log(file, str);
  96. }
  97. }
  98. }
  99. else if (PlayerInfo[i][pNation] == 1)
  100. {
  101. if(arrGroupData[iGroupID][g_iAllegiance] == 2)
  102. {
  103. if(arrGroupData[iGroupID][g_iGroupType] == 5)
  104. {
  105. new str[128], file[32];
  106. format(str, sizeof(str), "%s has paid $%s in tax.", GetPlayerNameEx(i), number_format((PlayerInfo[i][pPayCheck] / 100) * TaxValue));
  107. format(file, sizeof(file), "grouppay/%d/%d-%d-%d.log", iGroupID, month, day, year);
  108. Log(file, str);
  109. }
  110. }
  111. }
  112. }
  113. PlayerInfo[i][pAccount] += interest;
  114. format(string, sizeof(string), " Interest gained: $%s", number_format(interest));
  115. SendClientMessageEx(i, COLOR_GRAD3, string);
  116. SendClientMessageEx(i, COLOR_GRAD4, "______________________________________");
  117. 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)));
  118. SendClientMessageEx(i, COLOR_GRAD5, string);
  119.  
  120. GivePlayerCash(i, PlayerInfo[i][pPayCheck]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement