Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.10 KB | None | 0 0
  1. function PayDay() {
  2. new hour,minn,sec;
  3. gettime(hour,minn,sec);
  4. if(minn == 0 && Paydaydat == 0) PayDay2();
  5.  
  6. return true;
  7. }
  8. CMD:payday(playerid, params[]) {
  9. if(PlayerInfo[playerid][pAdmin] < 6) return AdmOnly(playerid);
  10. PayDay2();
  11.  
  12. return true;
  13. }
  14.  
  15. function PayDay2() {
  16.  
  17. SetTimer("ResetPD", 60000, false);
  18. Paydaydat = 1;
  19. new string[128];
  20. new interest,account[MAX_PLAYERS];
  21.  
  22. new rent[MAX_PLAYERS];
  23. SetTimer("ScadeLicentele", 4000, false);
  24.  
  25. foreach(Player,i) {
  26. if(IsPlayerConnected(i) && IsPlayerLogged[i] == 1) {
  27. new key = PlayerInfo[i][pHouse];
  28. if(key != 999)
  29. {
  30. rent[i] = HouseInfo[key][hRent];
  31. HouseInfo[key][hTakings] += rent[i];
  32. }
  33. new tmpintrate;
  34. SCM(i, COLOR_SERVER, "------------------------------------------------------------------------------------------------");
  35. if(PlayerInfo[i][pPremiumAccount] == 1)
  36. {
  37. tmpintrate = 2;
  38. PlayerInfo[i][pPayDayHad] += 1;
  39. if(PlayerInfo[i][pPayDayHad] >= 5) {
  40. PlayerInfo[i][pExp]++;
  41. PlayerInfo[i][pPayDayHad] = 0;
  42. }
  43. new bonus = PlayerInfo[i][pPayCheck] / 2;
  44. PlayerInfo[i][pPayCheck] += bonus;
  45. }
  46. else
  47. {
  48. tmpintrate = 1;
  49. }
  50. account[i] = PlayerInfo[i][pAccount];
  51. Tax += TaxValue;
  52.  
  53. //PlayerInfo[i][pAccount] -= TaxValue;
  54. new checks = PlayerInfo[i][pLevel]*2500+random(3000);
  55. if(PlayerInfo[i][pDailyLogin] == 0) checks = checks*2;
  56. GivePlayerCash(i, checks);
  57. interest = (PlayerInfo[i][pAccount]/5000)*(tmpintrate);
  58. if(PlayerInfo[i][pDailyLogin] == 0) interest = interest*2;
  59. if(PlayerInfo[i][pDailyLogin] == 0) PlayerInfo[i][pExp] += 2;
  60. else PlayerInfo[i][pExp] += 1;
  61. //[pet bonus]
  62.  
  63. new bani = 30000 + random(30000);
  64. if(PlayerInfo[i][pPetLevel] < 3) {
  65. PlayerInfo[i][pExp] += 1; }
  66. else if(PlayerInfo[i][pPetLevel] > 3) {
  67. PlayerInfo[i][pExp] += 2;
  68. GivePlayerCash(i, bani*PlayerInfo[i][pPetLevel]);
  69. Update(i, pCashx);
  70. }
  71.  
  72. PlayerInfo[i][pPetPoints] += 10;
  73. Update(i, pPetPointsx);
  74.  
  75. PlayerInfo[i][pSpinPoints] ++; UpdateVar(i, "SpinPoints", PlayerInfo[i][pSpinPoints]);
  76.  
  77. Update(i, pRP);
  78. UpdateProgress(i, 0);
  79. PlayerInfo[i][pAccount] += interest+1000;
  80.  
  81. SCM(i, COLOR_WHITE, "Salariul tau a sosit! Viziteaza banca pentru a retrage banii.");
  82. format(string, sizeof(string), "Ai primit %0.2f ore jucate. (%.0f minute)", PlayerInfo[i][pSeconds]/3600, PlayerInfo[i][pSeconds]/60);
  83. SCM(i, COLOR_WHITE, string);
  84. PlayerInfo[i][pConnectTime] += PlayerInfo[i][pSeconds]/3600;
  85. if(PlayerInfo[i][pSeconds] >= 1800) {
  86. new query[180];
  87. format(query, sizeof(query), "UPDATE `users` SET `DayHours`=`DayHours`+1 WHERE `ID`='%d'", PlayerInfo[i][pSQLID]);
  88. mysql_query(SQL, query);
  89. format(query, sizeof(query), "UPDATE `users` SET `HoursMonth`=`HoursMonth`+1 WHERE `ID`='%d'", PlayerInfo[i][pSQLID]);
  90. mysql_query(SQL, query);
  91.  
  92. if(PlayerInfo[i][pGiftPoints] < 5) {
  93. PlayerInfo[i][pGiftPoints] ++;
  94. Update(i, pGiftPointsx);
  95. }
  96. }
  97. PlayerInfo[i][pSeconds] = 0;
  98.  
  99. if(PlayerInfo[i][pDailyLogin] == 0) {
  100. PlayerInfo[i][pDailyLogin] = 1;
  101. UpdateVar(i, "DailyLogin", 1);
  102. SCM(i, COLOR_LIGHTBLUE, "Ai primit de doua ori mai multe respect points si bani pentru primul tau payday de astazi.");
  103. }
  104.  
  105. if(PlayerInfo[i][pHouse] != 999) {
  106. format(string, sizeof(string), "Paycheck: $%s | Rent: -$%d | Old Balance: $%s", FormatNumber(checks), HouseInfo[PlayerInfo[i][pHouse]][hRent], FormatNumber(account[i]));
  107. SCM(i, COLOR_GREY, string);
  108. format(string, sizeof(string), "Interest rate: 0.%d% | Interest: $%s | New balance: $%s", tmpintrate, FormatNumber(interest), FormatNumber(PlayerInfo[i][pAccount]));
  109. SCM(i, COLOR_GREY, string);
  110. }
  111. else {
  112. format(string, sizeof(string), "Paycheck: $%s | Rent: -$0 | Old Balance: $%s", FormatNumber(checks), FormatNumber(account[i]));
  113. SCM(i, COLOR_GREY, string);
  114. format(string, sizeof(string), "Interest rate: 0.%d% | Interest: $%s | New balance: $%s", tmpintrate, FormatNumber(interest), FormatNumber(PlayerInfo[i][pAccount]));
  115. SCM(i, COLOR_GREY, string);
  116. }
  117. /*if(PlayerInfo[playerid][pHouse] != 999) {
  118. PlayerTextDrawString(playerid, PaydayTD[1], "~h~~w~PAYDAY~n~~h~~n~~h~Bank Balance: $%s ~n~~w~Interest: $%s ~n~~w~Rent: $%d", FormatNumber(PlayerInfo[playerid][pAccount]), FormatNumber(interest), HouseInfo[PlayerInfo[playerid][pHouse]][hRent]);
  119. PlayerTextDrawShow(playerid, PaydayTD[1]);
  120. SetTimerEx("HidePayday", 8000, false, "i", playerid);
  121. }
  122. else {
  123. PlayerTextDrawString(playerid, PaydayTD[1], "~h~~w~PAYDAY~n~~h~~n~~h~Bank Balance: $%s ~n~~w~Interest: $%s ~n~~w~Rent: $0", FormatNumber(PlayerInfo[playerid][pAccount]), FormatNumber(interest));
  124. PlayerTextDrawShow(playerid, PaydayTD[1]);
  125. SetTimerEx("HidePayday", 8000, false, "i", playerid);
  126. }*/
  127. if(PlayerInfo[i][pPet] == 1) {
  128. PlayerInfo[i][pPayDay] = 0;
  129. PlayerInfo[i][pPayCheck] = 0;
  130. if(PlayerInfo[i][pPetLevel] < 3) {SCMEx(i, COLOR_YELLOW, "Deoarece pet-ul tau are level %d ai primit +1RP",PlayerInfo[i][pPetLevel]);}
  131. else SCMEx(i, COLOR_YELLOW, "Ai primit +2 RP si $%s deoarece pet-ul tau are level %d",FormatNumber(bani),PlayerInfo[i][pPetLevel]);
  132. SendClientMessage(i, COLOR_SERVER, "------------------------------------------------------------------------------------------------");
  133. }
  134. }
  135. }
  136. if(hour == 21) {
  137. new gold = 1 + random(4);
  138. new money = 10000 + random(5000);
  139. for(new h = 0; h < MAX_CLANS; h++) {
  140. if(strlen(ClanInfo[h][clName]) != 0) {
  141. if(GetClanTurfs(h) >= 10) {
  142. foreach(Player, i) {
  143. if(PlayerInfo[i][pClan] == h && h != 0) {
  144. PlayerInfo[i][pPremiumPoints] += gold;
  145. Update(i, pPremiumPointsx);
  146. GivePlayerCash(i, money);
  147. format(string, sizeof(string), "Ai primit %d puncte premium si $%s deoarece clanul tau are peste 10 teriotrii.", gold, FormatNumber(money));
  148. SCM(i, COLOR_MONEY, string);
  149. }
  150. }
  151. }
  152. }
  153. }
  154. }
  155. if(RestartPayday == 1) {
  156. SCMTA(COLOR_CLIENT, "Server-ul a fost restartat! Va rugam sa reveniti.");
  157. GameModeExit();
  158. }
  159. return 1;
  160. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement