Guest User

Untitled

a guest
Oct 16th, 2013
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.49 KB | None | 0 0
  1. public PayDay()
  2. {
  3. new string[128];
  4. new account,interest;
  5. new rent = 0;
  6. Tax += 10000000;
  7. GiftAllowed = 1;
  8. foreach(Player, i)
  9. if(TimeAfterBankJob < TIME_BETWEEN_BANKJOBS) TimeAfterBankJob += 1;
  10. for(new i = 0; i < MAX_PLAYERS; i++)
  11. {
  12. if(PlayerInfo[i][pLevel] > 0)
  13. {
  14. if(MoneyMessage[i]==1)
  15. {
  16. if( PlayerInfo[i][pJailed] < 1 && !IsACop(i))
  17. {
  18. format(string,sizeof(string),"You're failing to pay your debt of $%d - now the police are on the look out for you.",GetPlayerCash(i));
  19. SendClientMessageEx(i, COLOR_LIGHTRED, string);
  20. if(PlayerInfo[i][pWantedLevel] < 6) PlayerInfo[i][pWantedLevel] += 1;
  21. PlayerInfo[i][pCrimes] += 1;
  22. SetPlayerWantedLevel(i, PlayerInfo[i][pWantedLevel]);
  23. }
  24. }
  25. account = PlayerInfo[i][pAccount];
  26. if(PlayerInfo[i][pRenting] != INVALID_HOUSE_ID)
  27. {
  28. if(HouseInfo[PlayerInfo[i][pRenting]][hRentFee] > PlayerInfo[i][pAccount])
  29. {
  30. PlayerInfo[i][pRenting] = INVALID_HOUSE_ID;
  31. SendClientMessageEx(i, COLOR_WHITE, "You have been evicted.");
  32. }
  33. else {
  34. HouseInfo[PlayerInfo[i][pRenting]][hSafeMoney] += HouseInfo[PlayerInfo[i][pRenting]][hRentFee];
  35. PlayerInfo[i][pAccount] -= HouseInfo[PlayerInfo[i][pRenting]][hRentFee];
  36. }
  37. }
  38. new tmpintrate, faretax;
  39. tmpintrate = 1;
  40.  
  41. if(PlayerInfo[i][pLevel] <= 5) SendClientMessageEx(i,COLOR_LIGHTBLUE,"Need to travel somewhere and don't have wheels? Use '/service taxi' to call a cab!");
  42. if(PlayerInfo[i][pPayDay] >= 5)
  43. {
  44. if(GetPVarInt(i, "AdvisorDuty") == 1)
  45. {
  46. PlayerInfo[i][pDutyHours]++;
  47. }
  48. if(PlayerInfo[i][pDonateRank] > 0)
  49. {
  50. new bonus = PlayerInfo[i][pPayCheck] / 2;
  51. PlayerInfo[i][pPayCheck] += bonus;
  52. }
  53. if(SpecTimer == 1)
  54. {
  55. AddSpecialToken(i);
  56. }
  57. rent = 0;
  58. faretax = 0;
  59. new checks = PlayerInfo[i][pPayCheck];
  60. if(PlayerInfo[i][pTaxiLicense] == 1) faretax = (checks/100)*5;
  61. new Taxable = (( checks / 100 ) * TaxValue);
  62. PlayerInfo[i][pAccount] -= Taxable + faretax;
  63. Tax += Taxable + faretax;
  64.  
  65. interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate);
  66.  
  67. if(PlayerInfo[i][pDonateRank] == 0 && interest > 50000)
  68. {
  69. interest = 50000;
  70. }
  71. else if(PlayerInfo[i][pDonateRank] == 1 && interest > 100000)
  72. {
  73. interest = 100000;
  74. }
  75. else if(PlayerInfo[i][pDonateRank] == 2 && interest > 150000)
  76. {
  77. interest = 150000;
  78. }
  79. else if(PlayerInfo[i][pDonateRank] == 3 && interest > 200000)
  80. {
  81. interest = 200000;
  82. }
  83. else if(PlayerInfo[i][pDonateRank] >= 4 && interest > 250000)
  84. {
  85. interest = 250000;
  86. }
  87.  
  88.  
  89. PlayerInfo[i][pExp]++;
  90. PlayerInfo[i][pAccount] = account+interest;
  91. PlayerInfo[i][pTikis] += 1;
  92. SendClientMessageEx(i, COLOR_WHITE, "________ BANK STATEMENT ________");
  93. format(string, sizeof(string), " Paycheck: $%d | Tax Money: -$%d (%d percent)", checks, Taxable, TaxValue);
  94. SendClientMessageEx(i, COLOR_GRAD1, string);
  95.  
  96. if(PlayerInfo[i][pDonateRank] == 0)
  97. {
  98. format(string, sizeof(string), " Balance: $%d | Interest rate: 0.%d percent (50k max)", account, tmpintrate);
  99. SendClientMessageEx(i, COLOR_GRAD1, string);
  100. }
  101. else if(PlayerInfo[i][pDonateRank] == 1)
  102. {
  103. format(string, sizeof(string), " Balance: $%d | Interest rate: 0.%d percent {FFFF00}(Bronze VIP: 100k max)", account, tmpintrate);
  104. SendClientMessageEx(i, COLOR_GRAD1, string);
  105. }
  106. else if(PlayerInfo[i][pDonateRank] == 2)
  107. {
  108. format(string, sizeof(string), " Balance: $%d | Interest rate: 0.%d percent {FFFF00}(Silver VIP: 150k max)", account, tmpintrate);
  109. SendClientMessageEx(i, COLOR_GRAD1, string);
  110. }
  111. else if(PlayerInfo[i][pDonateRank] == 3)
  112. {
  113. format(string, sizeof(string), " Balance: $%d | Interest rate: 0.%d percent {FFFF00}(Gold VIP: 200k max)", account, tmpintrate);
  114. SendClientMessageEx(i, COLOR_GRAD1, string);
  115. }
  116. else if(PlayerInfo[i][pDonateRank] >= 4)
  117. {
  118. format(string, sizeof(string), " Balance: $%d | Interest rate: 0.%d percent {FFFF00}(Platinum VIP: 250k max)", account, tmpintrate);
  119. SendClientMessageEx(i, COLOR_GRAD1, string);
  120. }
  121. else if(PlayerInfo[i][pDonateRank] == 5)
  122. {
  123. format(string, sizeof(string), " Balance: $%d | Interest rate: 0.%d percent {FFFF00}(Server Investor: 250k max)", account, tmpintrate);
  124. SendClientMessageEx(i, COLOR_GRAD1, string);
  125. }
  126.  
  127. if(PlayerInfo[i][pTaxiLicense] == 1)
  128. {
  129. format(string, sizeof(string), " Taxi licensing fee (5 percent): -$%d",faretax);
  130. SendClientMessageEx(i, COLOR_GRAD2, string);
  131. }
  132. if(PlayerInfo[i][pMember] != 0 && PlayerInfo[i][pMember] != 8 && PlayerInfo[i][pMember] != 13)
  133. {
  134. if(Tax <= 0)
  135. {
  136. SendClientMessageEx(i,COLOR_RED,"The government is in debt; no money is available for pay.");
  137. }
  138. else
  139. {
  140. Tax -= FactionPay[PlayerInfo[i][pMember]-1][PlayerInfo[i][pRank]];
  141. format(string,sizeof(string)," Government pay: $%d", FactionPay[PlayerInfo[i][pMember]-1][PlayerInfo[i][pRank]]);
  142. SendClientMessageEx(i, COLOR_GRAD2, string);
  143. }
  144. }
  145. format(string, sizeof(string), " Interest gained: $%d", interest);
  146. SendClientMessageEx(i, COLOR_GRAD3, string);
  147. SendClientMessageEx(i, COLOR_GRAD4, "______________________________________");
  148. format(string, sizeof(string), " New balance: $%d | Rent paid: -$%d", PlayerInfo[i][pAccount],rent);
  149. SendClientMessageEx(i, COLOR_GRAD5, string);
  150.  
  151.  
  152. new paycheck = checks - Taxable - faretax;
  153. if(PlayerInfo[i][pMember] != 0 && PlayerInfo[i][pMember] != 8 && PlayerInfo[i][pMember] != 13 && Tax >= 0)
  154. {
  155. new facmemberpay = FactionPay[PlayerInfo[i][pMember]-1][PlayerInfo[i][pRank]];
  156. GivePlayerCash(i, facmemberpay);
  157. }
  158. GivePlayerCash(i, paycheck);
  159.  
  160. GameTextForPlayer(i, "~y~PayDay~n~~w~Paycheck", 5000, 1);
  161. SendAudioToPlayer(i, 1184, 100, 0);
  162. PlayerInfo[i][pPayDay] = 0;
  163. PlayerInfo[i][pPayCheck] = 0;
  164. PlayerInfo[i][pConnectTime] += 1;
  165. if(PlayerInfo[i][pConnectTime] == 2) SendClientMessageEx(i, COLOR_LIGHTRED, "You may now possess/use weapons!");
  166. if(PlayerInfo[i][pDonateRank] > 0)
  167. {
  168. PlayerInfo[i][pPayDayHad] += 1;
  169. if(PlayerInfo[i][pPayDayHad] >= 5)
  170. {
  171. PlayerInfo[i][pExp]++;
  172. PlayerInfo[i][pPayDayHad] = 0;
  173. }
  174. }
  175. if(PlayerInfo[i][pWRestricted] > 0)
  176. {
  177. PlayerInfo[i][pWRestricted]--;
  178. if(PlayerInfo[i][pWRestricted] == 0) SendClientMessageEx(i, COLOR_LIGHTRED, "Your weapons are no longer restricted!");
  179. }
  180.  
  181. }
  182. else
  183. {
  184. SendClientMessageEx(i, COLOR_LIGHTRED, "* You haven't played long enough to obtain a paycheck.");
  185. }
  186. }
  187. }
  188. for (new x=0; x<MAX_POINTS; x++)
  189. {
  190. Points[x][Announced] = 0;
  191. if (Points[x][Vulnerable] > 0)
  192. {
  193. Points[x][Vulnerable]--;
  194. UpdatePoints();
  195. }
  196. if(Points[x][Vulnerable] == 0 && Points[x][Announced] == 1)
  197. {
  198. }
  199. if (Points[x][Vulnerable] == 0 && Points[x][Type] >= 0 && Points[x][Announced] == 0 && Points[x][ClaimerId] == INVALID_PLAYER_ID)
  200. {
  201. //SetPlayerCheckpoint(i, Points[i][Pointx], Points[i][Pointy], Points[i][Pointz], 3);
  202. ReadyToCapture(x);
  203. Points[x][Announced] = 1;
  204. }
  205. }
  206. SaveStuff();
  207. SaveServerStats();
  208. FMemberCounter();
  209. return 1;
  210. }
Advertisement
Add Comment
Please, Sign In to add comment