Advertisement
Guest User

Untitled

a guest
Mar 27th, 2018
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.72 KB | None | 0 0
  1. CMD:payday(playerid, params[]) {
  2. new string[128];
  3. new interest,account[MAX_PLAYERS];
  4.  
  5. new rent[MAX_PLAYERS];
  6. SetTimer("ScadeLicentele", 4000, false);
  7. foreach(Player,i) {
  8. if(IsPlayerConnected(i) && IsPlayerLogged[i] == 1) {
  9. new key = PlayerInfo[i][pHouse];
  10. if(key != 999)
  11. {
  12. rent[i] = HouseInfo[key][hRent];
  13. HouseInfo[key][hTakings] += rent[i];
  14. }
  15. new tmpintrate;
  16. SendClientMessage(i, COLOR_SERVER, "------------------------------------------------------------------------------------------------");
  17. if(PlayerInfo[i][pPremiumAccount] == 1)
  18. {
  19. tmpintrate = 2;
  20. PlayerInfo[i][pPayDayHad] += 1;
  21. if(PlayerInfo[i][pPayDayHad] >= 5) {
  22. PlayerInfo[i][pExp]++;
  23. PlayerInfo[i][pPayDayHad] = 0;
  24. }
  25. new bonus = PlayerInfo[i][pPayCheck] / 2;
  26. PlayerInfo[i][pPayCheck] += bonus;
  27. }
  28. else
  29. {
  30. tmpintrate = 1;
  31. }
  32. account[i] = PlayerInfo[i][pAccount];
  33. Tax += TaxValue;
  34.  
  35. //PlayerInfo[i][pAccount] -= TaxValue;
  36. new checks = PlayerInfo[i][pLevel]*2500+random(3000);
  37. if(PlayerInfo[i][pDailyLogin] == 0) checks = checks*2;
  38. GivePlayerCash(i, checks);
  39. interest = (PlayerInfo[i][pAccount]/5000)*(tmpintrate);
  40. if(PlayerInfo[i][pDailyLogin] == 0) interest = interest*2;
  41. if(PlayerInfo[i][pDailyLogin] == 0) PlayerInfo[i][pExp] += 2;
  42. else PlayerInfo[i][pExp] += 1;
  43. UpdateProgress(i, 0);
  44. PlayerInfo[i][pAccount] += interest+1000;
  45.  
  46.  
  47. SCM(i, COLOR_WHITE, "Salariul tau a sosit! Viziteaza banca pentru a retrage banii.");
  48. format(string, sizeof(string), "Ai primit %0.2f ore jucate. (%.0f minute)", PlayerInfo[i][pSeconds]/3600, PlayerInfo[i][pSeconds]/60);
  49. SendClientMessage(i, COLOR_WHITE, string);
  50. PlayerInfo[i][pConnectTime] += PlayerInfo[i][pSeconds]/3600;
  51. if(PlayerInfo[i][pSeconds] >= 1800) {
  52. new query[180];
  53. format(query, sizeof(query), "UPDATE `users` SET `DayHours`=`DayHours`+1 WHERE `ID`='%d'", PlayerInfo[i][pSQLID]);
  54. mysql_query(SQL, query);
  55. format(query, sizeof(query), "UPDATE `users` SET `HoursMonth`=`HoursMonth`+1 WHERE `ID`='%d'", PlayerInfo[i][pSQLID]);
  56. mysql_query(SQL, query);
  57.  
  58. if(PlayerInfo[i][pGiftPoints] < 5) {
  59. PlayerInfo[i][pGiftPoints] ++;
  60. Update(i, pGiftPointsx);
  61. }
  62. }
  63. PlayerInfo[i][pSeconds] = 0;
  64.  
  65. if(PlayerInfo[i][pDailyLogin] == 0) {
  66. PlayerInfo[i][pDailyLogin] = 1;
  67. UpdateVar(i, "DailyLogin", 1);
  68. SCM(i, COLOR_LIGHTBLUE, "Ai primit de doua ori mai multe respect points si bani pentru primul tau payday de astazi.");
  69. }
  70.  
  71. if(PlayerInfo[i][pHouse] != 999) {
  72. format(string, sizeof(string), "Paycheck: $%s | Tax: -$%d | Rent: -$%d | Old Balance: $%s", FormatNumber(checks), FormatNumber(TaxValue), HouseInfo[PlayerInfo[i][pHouse]][hRent], FormatNumber(account[i]));
  73. SendClientMessage(i, COLOR_GREY, string);
  74. format(string, sizeof(string), "Interest rate: 0.%d% | Interest: $%s | New balance: $%s", tmpintrate, FormatNumber(interest), FormatNumber(PlayerInfo[i][pAccount]));
  75. SendClientMessage(i, COLOR_GREY, string);
  76. }
  77. else {
  78. format(string, sizeof(string), "Paycheck: $%s | Tax: -$%d | Rent: -$0 | Old Balance: $%s", FormatNumber(checks), FormatNumber(TaxValue), FormatNumber(account[i]));
  79. SendClientMessage(i, COLOR_GREY, string);
  80. format(string, sizeof(string), "Interest rate: 0.%d% | Interest: $%s | New balance: $%s", tmpintrate, FormatNumber(interest), FormatNumber(PlayerInfo[i][pAccount]));
  81. SendClientMessage(i, COLOR_GREY, string);
  82. }
  83.  
  84. PlayerInfo[i][pPayDay] = 0;
  85. PlayerInfo[i][pPayCheck] = 0;
  86. SendClientMessage(i, COLOR_SERVER, "------------------------------------------------------------------------------------------------");
  87. }
  88. }
  89. return 1;
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement