Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2020
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.38 KB | None | 0 0
  1. public PayDay()
  2. {
  3. new string[128],
  4. str[256],
  5. string3[128],
  6. interest,
  7. account[MAX_PLAYERS],
  8. hour,
  9. minn,
  10. sec,
  11. expamount,
  12. rent[MAX_PLAYERS];
  13. gettime(hour,minn,sec);
  14. foreach(Player,i)
  15. {
  16. if(PlayerInfo[i][pAchivPayday] == 0)
  17. {
  18. SCM(i, COLOR_ADMCHAT, "Ai primit $30,000 + 1 punct premium pentru deblocarea realizarii 'The Payday'");
  19. PlayerInfo[i][pPremiumPoints] += 1;
  20. Update(i, pPremiumPointsx);
  21. PlayerInfo[i][pAchivPayday] = 1;
  22. PlayerInfo[i][pPremiumPoints] += 2;
  23. Update(i, pAchivPaydayx);
  24. Update(i, pPremiumPointsx);
  25. }
  26. PlayerInfo[i][pAchivPayday] += 1;
  27. Update(i, pAchivPaydayx);
  28. if(PlayerInfo[i][pAchivPayday] == 21)
  29. {
  30. SCM(i, COLOR_ADMCHAT, "Ai primit $30,000 + 1 punct premium pentru deblocarea realizarii 'The Gamer'");
  31. PlayerInfo[i][pPremiumPoints] += 1;
  32. Update(i, pPremiumPointsx);
  33. PlayerInfo[i][pPremiumPoints] += 2;
  34. Update(i, pPremiumPointsx);
  35. }
  36. if(PlayerInfo[i][pAchivPayday] == 501)
  37. {
  38. SCM(i, COLOR_ADMCHAT, "Ai primit $30,000 + 1 punct premium pentru deblocarea realizarii 'The Unstoppable'");
  39. PlayerInfo[i][pPremiumPoints] += 1;
  40. Update(i, pPremiumPointsx);
  41. PlayerInfo[i][pPremiumPoints] += 2;
  42. Update(i, pPremiumPointsx);
  43. }
  44. if(PlayerInfo[i][pAchivPayday] == 1001)
  45. {
  46. SCM(i, COLOR_ADMCHAT, "Ai primit $30,000 + 1 punct premium pentru deblocarea realizarii 'The PC Burner'");
  47. PlayerInfo[i][pPremiumPoints] += 1;
  48. Update(i, pPremiumPointsx);
  49. PlayerInfo[i][pPremiumPoints] += 2;
  50. Update(i, pPremiumPointsx);
  51. }
  52. if(hour == 7 && minn == 00)
  53. {
  54. PlayerInfo[i][pMisiuni] = 0;
  55. Misiune1[i] = 0;
  56. Misiune2[i] = 0;
  57. Misiune3[i] = 0;
  58. Misiune4[i] = 0;
  59. Misiune5[i] = 0;
  60. PlayerInfo[i][pProgres1] = 0;
  61. PlayerInfo[i][pProgres2] = 0;
  62. PlayerInfo[i][pProgres3] = 0;
  63. PlayerInfo[i][pProgres4] = 0;
  64. PlayerInfo[i][pProgres5] = 0;
  65. }
  66. if(IsPlayerConnected(i))
  67. {
  68. if(PlayerInfo[i][pLevel] >= 0)
  69. {
  70. new wakaname[25];
  71. GetPlayerName(i,wakaname,sizeof(wakaname));
  72. if(MoneyMessage[i]==1)
  73. {
  74. SendClientMessage(i, COLOR_LIGHTRED, "You failed to pay your debt, Jail time.");
  75. new rand;
  76. rand = random(sizeof(gRandomJailSpawns));
  77. SetPlayerInterior(i, 6);
  78. SetPlayerPosEx(i,gRandomJailSpawns[rand][0],gRandomJailSpawns[rand][1],gRandomJailSpawns[rand][2]);
  79. PlayerInfo[i][pJailed] = 1;
  80. ResetPlayerWeaponsEx(i);
  81. ResetPlayerWeapons(i);
  82. WantedPoints[i] = 0;
  83. PlayerInfo[i][pJailTime] = 240;
  84. format(string, sizeof(string), "You are jailed for %d seconds. Bail: Unable", PlayerInfo[i][pJailTime]);
  85. SendClientMessage(i, COLOR_LIGHTBLUE, string);
  86. Update(i,pJailedx);
  87. Update(i,pJailTimex);
  88. TogglePlayerControllable(i, 0);
  89. SetTimerEx("UnFreezeStation", 1000, false, "i", i);
  90. }
  91. new key = PlayerInfo[i][pPhousekey];
  92. if(key != 0)
  93. {
  94. rent[i] = HouseInfo[key][hRent];
  95. if(rent[i] > GetPlayerCash(i) && strcmp(PlayerInfo[i][pNormalName], HouseInfo[key][hOwner], false) == 0)
  96. {
  97. PlayerInfo[i][pPhousekey] = 0;
  98. Update(i,pPhousekeyx);
  99. }
  100. HouseInfo[key][hTakings] += rent[i];
  101. mysql_format(SQL,str,sizeof(str),"UPDATE `houses` SET `Takings`='%d' WHERE `ID`='%d'",HouseInfo[key][hTakings],key);
  102. mysql_tquery(SQL,str,"","");
  103. }
  104. new tmpintrate;
  105. if(PlayerInfo[i][pPremiumAccount] == 1)
  106. {
  107. tmpintrate = 2;
  108. new bonus = PlayerInfo[i][pPayCheck] / 2;
  109. PlayerInfo[i][pPayCheck] += bonus;
  110. }
  111. else
  112. {
  113. tmpintrate = 1;
  114. }
  115. account[i] = PlayerInfo[i][pAccount];
  116. Tax += TaxValue;
  117. PlayerInfo[i][pAccount] -= TaxValue;
  118. new checks = PlayerInfo[i][pPayCheck];
  119. PlayerInfo[i][pAccount] += checks;
  120. PlayerInfo[i][pCKey] += 1;
  121. Update(i, pCKeyx);
  122. interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate);
  123. new finalinterest;
  124. SendClientMessage(i, COLOR_TEAL, "----------------------------------------------------------------------------");
  125. SendClientMessage(i, COLOR_WHITE, "Your paycheck has arrived; please visit the bank to withdraw your money.");
  126. if(PlayerInfo[i][pRob] < 20)
  127. {
  128. PlayerInfo[i][pRob]++;
  129. }
  130. else
  131. {
  132. SendClientMessage(i, COLOR_WHITE, "Nu ai primit niciun rob/free point pentru ca ai deja 20 rob/free points.");
  133. }
  134. MoneyBet[i] = 0;
  135. BetOnHorse[i] = 0;
  136. if(PlayerInfo[i][pPayDay] >= 1800)
  137. {
  138. PlayerInfo[i][pConnectTime] += 1;
  139. finalinterest = interest;
  140. PlayerInfo[i][pPayDay] = 0;
  141. if(PlayerInfo[i][pGiftTime] > 0)
  142. {
  143. PlayerInfo[i][pGiftTime] -= 1;
  144. Update(i, pGiftTimex);
  145. }
  146. }
  147. else
  148. {
  149. finalinterest = interest / 2;
  150. new stringsu[256];
  151. format(stringsu,sizeof(stringsu),"Ai primit doar jumatate din dobanda de la banca pentru ca ai jucat doar %d minute din aceasta ora (31 necesare pentru dobanda intreaga.",PlayerInfo[i][pPayDay]/60+1);
  152. SendSplitMessage(i, COLOR_LIGHTBLUE, stringsu);
  153. }
  154. PlayerInfo[i][pExp] += 1;
  155. PlayerInfo[i][pAccount] += finalinterest;
  156. format(string, sizeof(string), "Paycheck: $%s | Bank balance: $%s | Bank interest: $%s | Tax: $%s (10 percent)", FormatNumber(checks), FormatNumber(PlayerInfo[i][pAccount]), FormatNumber(finalinterest), FormatNumber(TaxValue));
  157. SendClientMessage(i, COLOR_GREY, string);
  158. format(string3, sizeof(string3), "Rent: $%s | Total earnings: $%d", FormatNumber(rent[i]), checks-TaxValue);
  159. SendClientMessage(i, COLOR_GREY, string3);
  160. SendClientMessage(i, COLOR_TEAL, "----------------------------------------------------------------------------");
  161. format(string, sizeof(string), "~y~payday");
  162. GameTextForPlayer(i, string, 5000, 1);
  163. if(GetWeekDay() == 2 && hour == 20)
  164. {
  165. if(PlayerInfo[i][pRank] == 1)
  166. {
  167. GivePlayerCash(i, 300000);
  168. ShowPlayerDialog(i, 12122, DIALOG_STYLE_MSGBOX, "{FFFFFF}Info Salarii ","{ff0000}»{ffffff}Ai primit salariul tau de 300.000$", "ok", "Close");
  169. }
  170. if(PlayerInfo[i][pRank] == 2)
  171. {
  172. GivePlayerCash(i, 400000);
  173. ShowPlayerDialog(i, 12122, DIALOG_STYLE_MSGBOX, "{FFFFFF}Info Salarii ","{ff0000}»{ffffff}Ai primit salariul tau de 400.000$", "ok", "Close");
  174. }
  175. if(PlayerInfo[i][pRank] == 3)
  176. {
  177. GivePlayerCash(i, 500000);
  178. ShowPlayerDialog(i, 12122, DIALOG_STYLE_MSGBOX, "{FFFFFF}Info Salarii ","{ff0000}»{ffffff}Ai primit salariul tau de 500.000$", "ok", "Close");
  179. }
  180. if(PlayerInfo[i][pRank] == 4)
  181. {
  182. GivePlayerCash(i, 550000);
  183. ShowPlayerDialog(i, 12122, DIALOG_STYLE_MSGBOX, "{FFFFFF}Info Salarii ","{ff0000}»{ffffff}Ai primit salariul tau de 550.000$", "ok", "Close");
  184. }
  185. if(PlayerInfo[i][pRank] == 5)
  186. {
  187. GivePlayerCash(i, 750000);
  188. ShowPlayerDialog(i, 12122, DIALOG_STYLE_MSGBOX, "{FFFFFF}Info Salarii ","{ff0000}»{ffffff}Ai primit salariul tau de 750.000$", "ok", "Close");
  189. }
  190. if(PlayerInfo[i][pRank] == 6)
  191. {
  192. GivePlayerCash(i, 950000);
  193. ShowPlayerDialog(i, 12122, DIALOG_STYLE_MSGBOX, "{FFFFFF}Info Salarii ","{ff0000}»{ffffff}Ai primit salariul tau de 950.000$", "ok", "Close");
  194. }
  195. if(PlayerInfo[i][pRank] == 7)
  196. {
  197. GivePlayerCash(i, 1000000);
  198. ShowPlayerDialog(i, 12122, DIALOG_STYLE_MSGBOX, "{FFFFFF}Info Salarii ","{ff0000}»{ffffff}Ai primit salariul tau de 1.000.000$", "ok", "Close");
  199. }
  200. }
  201. if(PlayerInfo[i][pMember] >= 0)
  202. {
  203. PlayerInfo[i][pOrejucate] += 1;
  204. Update(i, pOrejucate);
  205. }
  206. if(PlayerInfo[i][pCarLicT] > 0)
  207. {
  208. PlayerInfo[i][pCarLicT] -= 1;
  209. }
  210. if(PlayerInfo[i][pFlyLicT] > 0)
  211. {
  212. PlayerInfo[i][pFlyLicT] -= 1;
  213. }
  214. if(PlayerInfo[i][pBoatLicT] > 0)
  215. {
  216. PlayerInfo[i][pBoatLicT] -= 1;
  217. }
  218. if(PlayerInfo[i][pGunLicT] > 0)
  219. {
  220. PlayerInfo[i][pGunLicT] -= 1;
  221. }
  222. if(PlayerInfo[i][pFpunish] > 0)
  223. {
  224. PlayerInfo[i][pFpunish]--;
  225. }
  226. if(PlayerInfo[i][pFpunish] < 0)
  227. {
  228. PlayerInfo[i][pFpunish] = 0;
  229. }
  230. if(PlayerInfo[i][pCarLicSuspend] > 0)
  231. {
  232. PlayerInfo[i][pCarLicSuspend]--;
  233. Update(i, pCarLicSuspendx);
  234. if(PlayerInfo[i][pCarLicSuspend] == 0) SendClientMessage(i, COLOR_YELLOW, "* Licenta ta de condus a fost confiscata recent. Acum poti merge din nou la scoala de soferi pentru a lua licenta din nou.");
  235. }
  236. if(PlayerInfo[i][pGunLicSuspend] > 0)
  237. {
  238. PlayerInfo[i][pGunLicSuspend]--;
  239. Update(i, pGunLicSuspendx);
  240. if(PlayerInfo[i][pGunLicSuspend] == 0) SendClientMessage(i, COLOR_YELLOW, "* Licenta ta de arme a fost confiscata recent. Acum poti da din nou testul cu un instructor pentru a lua licenta din nou.");
  241. }
  242. if(IsACop(i))
  243. {
  244. PlayerInfo[i][pLawyer] += 1;
  245. }
  246. PlayerInfo[i][pPayCheck] = 0;
  247. if(PlayerInfo[i][pLevel] == 1 || PlayerInfo[i][pLevel] == 2 || PlayerInfo[i][pLevel] == 3 || PlayerInfo[i][pLevel] == 4)
  248. {
  249. expamount = PlayerInfo[i][pLevel]*2;
  250. if(PlayerInfo[i][pExp] >= expamount)
  251. {
  252. SCM(i,COLOR_LIGHTBLUE,"** You can use buylevel because you have necessary respect points.");
  253. }
  254. }
  255. else if(PlayerInfo[i][pLevel] >= 5)
  256. {
  257. expamount = PlayerInfo[i][pLevel]*3;
  258. if(PlayerInfo[i][pExp] >= expamount)
  259. {
  260. SCM(i,COLOR_LIGHTBLUE,"** You can use buylevel because you have necessary respect points.");
  261. }
  262. }
  263. }
  264. }
  265. }
  266. for(new x = 0; x < MAX_GROUPS; x++)
  267. {
  268. DynamicFactions[x][fBank] += DynamicFactions[x][fPaydayMoney];
  269. mysql_format(SQL,str,sizeof(str),"UPDATE `factions` SET `Bank`='%d' WHERE `ID`='%d'",DynamicFactions[x][fBank],x);
  270. mysql_tquery(SQL,str,"","");
  271. }
  272. return 1;
  273. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement