Advertisement
Guest User

Untitled

a guest
May 19th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.27 KB | None | 0 0
  1. public PayDay()
  2. {
  3. /*if(LottoAuto >= 6)
  4. {
  5. new string[256];
  6. format(string, sizeof(string), "Nouvelle lotterie: Nous avons commence la loterie OGLotto's.");
  7. OOCOff(COLOR_WHITE, string);
  8. new rand = random(100);
  9. if(rand == 0) { new rand2 = random(50);
  10. rand += rand2; }
  11. Lotto(rand);
  12. LottoAuto = 0;
  13. } else { LottoAuto++; }*/
  14. new string[256],interest;
  15. for(new i = 0; i < MAX_PLAYERS; i++)
  16. {
  17. if(IsPlayerConnected(i) && gPlayerLogged[i] == 1 && TempsCM[i] == 1)
  18. {
  19. PlayerInfo[i][pPayDayHad] += 1;
  20. if(PlayerInfo[i][pPayDayHad] >= 6)
  21. {
  22. antidm[i] = 0; tabasser[i] = 0; violer[i] = 0;
  23. if(PlayerInfo[i][pNiveau] >= 1)
  24. {
  25. new anciencompte = 0,rent = 0;
  26. anciencompte = PlayerInfo[i][pAccount];
  27. if(MoneyMessage[i] == 1)
  28. {
  29. if(PlayerInfo[i][pCash] <= 0 && PlayerInfo[i][pAccount] <= 0)
  30. {
  31. SendClientMessage(i, COLOR_LIGHTRED, "Vous n'avez pas d'argent, la Banque porte plainte sur vous, vous allez en prison.");
  32. SetPlayerInterior(i, 10);
  33. new rand; rand = random(sizeof(PrisonSpawns)); attacher[i] = 1;
  34. SafeSetPlayerPos(i,PrisonSpawns[rand][0], PrisonSpawns[rand][1], PrisonSpawns[rand][2]);
  35. PlayerInfo[i][pJailed] = 3; SafeResetPlayerWeapons(i); WantedPoints[i] = 0;
  36. PlayerInfo[i][pWantedPoint] = 0; PlayerInfo[i][pJailTime] += 240;
  37. SafeResetPlayerWeapons(i); format(string, sizeof(string), "Vous êtes condamné à la prison pour %d secondes. Mise en liberte sous caution: Impossible", PlayerInfo[i][pJailTime]);
  38. SendClientMessage(i, COLOR_LIGHTBLUE, string);
  39. SafeResetMoney(i);
  40. PlayerInfo[i][pAccount] = 0;
  41. }
  42. if(PlayerInfo[i][pCash] >= 1 && PlayerInfo[i][pAccount] <= 0)
  43. {
  44. SafeGiveMoney(i, -PlayerInfo[i][pAccount]);
  45. PlayerInfo[i][pAccount] = 0;
  46. SendClientMessage(i, COLOR_LIGHTRED, " Vous avez remboursé la Banque! Vous deviez de l'argent ou vous n'aviez pas assez d'argent sur votre compte, vous avez rembourser la banque... ");
  47. }
  48. }
  49. new playername2[MAX_PLAYER_NAME],key = 255,bkey = 255,argentb = 0,salaire = 0;
  50. GetPlayerName(i, playername2, sizeof(playername2));
  51. key = PlayerInfo[i][pPhousekey];
  52. bkey = PlayerInfo[i][pPbiskey];
  53. new ebill = 0;
  54. //electriciter Maison
  55. if(key != 255)
  56. {
  57. rent = HouseInfo[key][hRent];
  58. if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0) {
  59. rent = 0;
  60. ebill = HouseInfo[key][hValue]/1000;
  61. Tax = 30;
  62. } else if(rent > PlayerInfo[i][pAccount]) {
  63. PlayerInfo[i][pPhousekey] = 255;
  64. SendClientMessage(i, COLOR_WHITE, "Vous avez été expulsé.");
  65. rent = 0;
  66. ebill = 0;
  67. } else if(rent < PlayerInfo[i][pAccount]) {
  68. PlayerInfo[i][pAccount] -= rent;
  69. ebill = 0;
  70. }
  71. HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
  72. }
  73. //electriciter Bizz
  74. if(bkey != 255) {
  75. if(strcmp(playername2, BizzInfo[bkey][bOwner], true) == 0) {
  76. argentb = BizzInfo[bkey][bBuyPrice]/1000;
  77. ebill = ebill+argentb;
  78. Tax = 30;
  79. }
  80. if(strcmp(playername2, SBizzInfo[bkey][sbOwner], true) == 0) {
  81. argentb = SBizzInfo[bkey][sbBuyPrice]/1000;
  82. ebill = ebill+argentb;
  83. Tax = 30;
  84. }
  85. }
  86. // Jour de paie
  87. new argenta = 0,carkey = 999,argentfinal = 0;
  88. carkey = PlayerInfo[i][pPcarkey];
  89. if(carkey != 999) {
  90. if(strcmp(playername2, CarInfo[carkey][cOwner], true) == 0) {
  91. argenta = CarInfo[carkey][cValue]/1000;
  92. } else {
  93. argenta = 0;
  94. }
  95. }
  96. // Interrer
  97. new tmpintrate = 1;
  98. tmpintrate = 1;
  99. interest = PlayerInfo[i][pAccount]/1000;
  100. if(interest <= 1) { interest = 0; }
  101. if(interest >= 10000) {
  102. interest = PlayerInfo[i][pNiveau]*100;
  103. }
  104.  
  105. // Salaire
  106. if(PlayerInfo[i][pMembreFaction] == 2)
  107. {
  108. if(PlayerInfo[i][pRank] == 1) { salaire = 500; }
  109. else if(PlayerInfo[i][pRank] == 2) { salaire = 600; }
  110. else if(PlayerInfo[i][pRank] == 3) { salaire = 675; }
  111. else if(PlayerInfo[i][pRank] == 4) { salaire = 750; }
  112. else if(PlayerInfo[i][pRank] == 5) { salaire = 900; }
  113. else if(PlayerInfo[i][pRank] == 6) { salaire = 1100; }
  114. }
  115. else if(PlayerInfo[i][pMembreFaction] == 4)
  116. {
  117. if(PlayerInfo[i][pRank] == 1) { salaire = 600; }
  118. else if(PlayerInfo[i][pRank] == 2) { salaire = 700; }
  119. else if(PlayerInfo[i][pRank] == 3) { salaire = 775; }
  120. else if(PlayerInfo[i][pRank] == 4) { salaire = 850; }
  121. else if(PlayerInfo[i][pRank] == 5) { salaire = 1000; }
  122. else if(PlayerInfo[i][pRank] == 6) { salaire = 1200; }
  123. }
  124. else if(PlayerInfo[i][pMembreFaction] == 11)
  125. {
  126. if(PlayerInfo[i][pRank] == 1) { salaire = 400; }
  127. else if(PlayerInfo[i][pRank] == 2) { salaire = 550; }
  128. else if(PlayerInfo[i][pRank] == 3) { salaire = 625; }
  129. else if(PlayerInfo[i][pRank] == 4) { salaire = 700; }
  130. else if(PlayerInfo[i][pRank] == 5) { salaire = 800; }
  131. else if(PlayerInfo[i][pRank] == 6) { salaire = 1000; }
  132. }
  133. else if(PlayerInfo[i][pMembreFaction] == 7)
  134. {
  135. if(PlayerInfo[i][pRank] == 1) { salaire = 700; }
  136. else if(PlayerInfo[i][pRank] == 2) { salaire = 775; }
  137. else if(PlayerInfo[i][pRank] == 3) { salaire = 825; }
  138. else if(PlayerInfo[i][pRank] == 4) { salaire = 900; }
  139. else if(PlayerInfo[i][pRank] == 5) { salaire = 1300; }
  140. else if(PlayerInfo[i][pRank] == 6) { salaire = 1500; }
  141. }
  142. else { salaire = 400; }
  143.  
  144. PlayerInfo[i][pAccount] += interest; // Interrer
  145. PlayerInfo[i][pAccount] -= argenta; // Assurance voiture
  146. PlayerInfo[i][pAccount] -= ebill; // Electriciter
  147. if(ebill >= 1) { SBizzInfo[4][sbTill] += ebill/20; }
  148. TaxValue += Tax; PlayerInfo[i][pAccount] -= Tax;
  149. SendClientMessage(i, COLOR_ORANGE, "|___ BANQUE DE DÉCLARATION ___|");
  150. format(string, sizeof(string), " Taux d'interêt: %d/100 Interêt acquise %d$",tmpintrate,interest);
  151. SendClientMessage(i, COLOR_WHITE, string);
  152. format(string, sizeof(string), " Loyer: -%d$ | Facture d'electricite: -%d$", rent,ebill);
  153. SendClientMessage(i, COLOR_WHITE, string);
  154. format(string, sizeof(string), " Salaire: %d$ | Impots: -%d$", salaire, Tax);
  155. SendClientMessage(i, COLOR_WHITE, string);
  156. format(string, sizeof(string), " Assurance véhicule: -%d$", argenta);
  157. SendClientMessage(i, COLOR_GRAD5, string);
  158. SendClientMessage(i, COLOR_LIGHTRED, "|-----------------------------------------------|");
  159. format(string, sizeof(string), " Ancien Solde: %d$ | Nouveau Solde: %d$",anciencompte,PlayerInfo[i][pAccount]);
  160. SendClientMessage(i, COLOR_WHITE, string);
  161. if(anciencompte > PlayerInfo[i][pAccount]) {
  162. argentfinal = anciencompte-PlayerInfo[i][pAccount];
  163. format(string, sizeof(string), " Perte de %d$ sur votre compte en banque.", argentfinal);
  164. SendClientMessage(i,COLOR_BROWN, string);
  165. }
  166. else if(anciencompte == PlayerInfo[i][pAccount]) {
  167. SendClientMessage(i,COLOR_GREEN, " Aucune perte ou de gain sur votre compte en banque.");
  168. } else {
  169. argentfinal = PlayerInfo[i][pAccount]-anciencompte;
  170. format(string, sizeof(string), " Gain de %d$ sur votre compte en banque.",argentfinal);
  171. SendClientMessage(i,COLOR_GREEN, string);
  172. }
  173. SendClientMessage(i, COLOR_LIGHTBLUE, "|-----------------------------------------------|");
  174. format(string, sizeof(string), "~y~La Paie");
  175. GameTextForPlayer(i, string, 5000, 1);
  176. rent = 0;
  177. PlayerInfo[i][pPayCheck] = 0; PlayerInfo[i][pPayDayHad] = 1; PlayerInfo[i][pPayDay] = 0;
  178. PlayerPlayMusic(i); PlayerInfo[i][pExp]++; PlayerInfo[i][pConnectTime] += 1;
  179.  
  180. SendClientMessage(i, COLOR_LIGHTGREEN, "|-------------------|");
  181. SendClientMessage(i, COLOR_GREEN, "Vous avez reçu un point de respect en plus et 100$ pour nous excusez du dérangement pour les comptes");
  182. PlayerInfo[i][pExp]++; PlayerInfo[i][pAccount] += 100;
  183. }
  184. }
  185. }
  186. }
  187. return 1;
  188. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement