Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2013
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.79 KB | None | 0 0
  1. }
  2. }
  3. else if(strcmp(x_job,"reparation",true) == 0)
  4. {
  5. if(RepairOffer[playerid] < 999)
  6. {
  7. if(GetPlayerMoney(playerid) > RepairPrice[playerid])
  8. {
  9. if(IsPlayerInAnyVehicle(playerid))
  10. {
  11. if(IsPlayerConnected(RepairOffer[playerid]))
  12. {
  13. GetPlayerName(RepairOffer[playerid], giveplayer, sizeof(giveplayer));
  14.  
  15. RepairCar[playerid] = GetPlayerVehicleID(playerid);
  16. SetVehicleHealth(RepairCar[playerid], 1000.0);
  17. RepairVehicle(GetPlayerVehicleID(playerid));
  18. format(string, sizeof(string), "* Vous réparez votre vehicule pour $%d auprès de %s.",RepairPrice[playerid],giveplayer);
  19. SendClientMessage(playerid, COLOR_WHITE, string);
  20. format(string, sizeof(string), "* Vous avez réparé le vehicule de %s pour $%d .",sendername,RepairPrice[playerid]);
  21. SendClientMessage(RepairOffer[playerid], COLOR_WHITE, string);
  22. PlayerInfo[RepairOffer[playerid]][pMechSkill] ++;
  23. if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 50)
  24. { SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Votre skill de mécanicien est maintenant au level 2, vous pouvez maintenant remplir plus d'essence dans les vehicules."); }
  25. else if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 100)
  26. { SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Votre skill de mécanicien est maintenant au Level 3, vous pouvez maintenant remplir plus d'essence dans les vehicules."); }
  27. else if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 200)
  28. { SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Votre skill de mécanicien est maintenant au Level 4, vous pouvez maintenant remplir plus d'essence dans les vehicules."); }
  29. else if(PlayerInfo[RepairOffer[playerid]][pMechSkill] == 400)
  30. { SendClientMessage(RepairOffer[playerid], COLOR_YELLOW, "* Votre skill de mécanicien est maintenant au Level 5, vous pouvez maintenant remplir plus d'essence dans les vehicules."); }
  31. SafeGivePlayerMoney(playerid, -RepairPrice[playerid]);
  32. SafeGivePlayerMoney(RepairOffer[playerid], RepairPrice[playerid]);
  33. RepairOffer[playerid] = 999;
  34. RepairPrice[playerid] = 0;
  35. SBizzInfo[21][sbTill] += SBizzInfo[21][sbEntranceCost];
  36. ExtortionSBiz(21, SBizzInfo[21][sbEntranceCost]);
  37. SBizzInfo[21][sbProducts]--;
  38. OnPropUpdate(3,21);
  39. if(IsAnOwnableCar(RepairCar[playerid]))
  40. {
  41. if(CarInfo[RepairCar[playerid]][cPrix] >= 1)
  42. {
  43. CarInfo[RepairCar[playerid]][cPrix] = CarInfo[RepairCar[playerid]][cPrix] - 3000;
  44. OnPropUpdate(4,RepairCar[playerid]);
  45. }
  46. }
  47. return 1;
  48. }
  49. return 1;
  50. }
  51. return 1;
  52. }
  53. else
  54. {
  55. SendClientMessage(playerid, COLOR_GREY, " Vous n'avez pas asser d'argent pour la réparation !");
  56. return 1;
  57. }
  58. }
  59. else
  60. {
  61. SendClientMessage(playerid, COLOR_GREY, " Personne vous a proposé de réparer votre vehicule !");
  62. return 1;
  63. }
  64. }
  65. else { return 1; }
  66. }//not connected
  67. return 1;
  68. }
  69. if(strcmp(cmd, "/refill", true) == 0 || strcmp(cmd, "/remplir", true) == 0)
  70. {
  71. if(IsPlayerConnected(playerid))
  72. {
  73. if(PlayerInfo[playerid][pJob] != 7)
  74. {
  75. SendClientMessage(playerid, COLOR_GREY, " Vous n'êtes pas mécanicien!");
  76. return 1;
  77. }
  78. tmp = strtok(cmdtext, idx);
  79. if(!strlen(tmp))
  80. {
  81. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /remplir [id] [prix]");
  82. return 1;
  83. }
  84. new playa;
  85. new money;
  86. playa = ReturnUser(tmp);
  87. tmp = strtok(cmdtext, idx);
  88. money = strval(tmp);
  89. if(money < 1 || money > 9999) { SendClientMessage(playerid, COLOR_GREY, " Le prix doit être compris entre 1 et 9999!"); return 1; }
  90. if(IsPlayerConnected(playa))
  91. {
  92. if(playa != INVALID_PLAYER_ID)
  93. {
  94. if(ProxDetectorS(8.0, playerid, playa)&& IsPlayerInAnyVehicle(playa))
  95. {
  96. if(playa == playerid) { SendClientMessage(playerid, COLOR_GREY, " Vous ne pouvez pas faire ça!"); return 1; }
  97. GetPlayerName(playa, giveplayer, sizeof(giveplayer));
  98.  
  99. format(string, sizeof(string), "* Vous proposez à %s de remplir son vehicule d'essence pour $%d .",giveplayer,money);
  100. SendClientMessage(playerid, COLOR_WHITE, string);
  101. format(string, sizeof(string), "* Mécanicien %s vous propose de remplir d'essence votre vehicule pour $%d, (tapez /accepter plein) pour accepter.",sendername,money);
  102. SendClientMessage(playa, COLOR_WHITE, string);
  103. RefillOffer[playa] = playerid;
  104. RefillPrice[playa] = money;
  105. }
  106. else
  107. {
  108. SendClientMessage(playerid, COLOR_GREY, " Ce joueur n'est pas vers vous ou dans un vehicule.");
  109. }
  110. }
  111. }
  112. else
  113. {
  114. SendClientMessage(playerid, COLOR_GREY, " Ce joueur est hors-ligne.");
  115. }
  116. }
  117. return 1;
  118. }
  119. if(strcmp(cmd, "/repair", true) == 0 || strcmp(cmd, "/reparer", true) == 0)
  120. {
  121. if(IsPlayerConnected(playerid))
  122. {
  123. if(PlayerInfo[playerid][pJob] != 7)
  124. {
  125. SendClientMessage(playerid, COLOR_GREY, " Vous n'êtes pas mécanicien!");
  126. return 1;
  127. }
  128. tmp = strtok(cmdtext, idx);
  129. if(!strlen(tmp))
  130. {
  131. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /reparer [id] [prix]");
  132. return 1;
  133. }
  134. new playa;
  135. new money;
  136. playa = ReturnUser(tmp);
  137. tmp = strtok(cmdtext, idx);
  138. money = strval(tmp);
  139. if(money < 1 || money > 9999) { SendClientMessage(playerid, COLOR_GREY, " Le prix doit être compris entre 1 et 9999!"); return 1; }
  140. if(IsPlayerConnected(playa))
  141. {
  142. if(playa != INVALID_PLAYER_ID)
  143. {
  144. if(ProxDetectorS(8.0, playerid, playa)&& IsPlayerInAnyVehicle(playa))
  145. {
  146. if(playa == playerid) { SendClientMessage(playerid, COLOR_GREY, " Vous ne pouvez pas faire ça!"); return 1; }
  147. GetPlayerName(playa, giveplayer, sizeof(giveplayer));
  148.  
  149. format(string, sizeof(string), "* Vous proposez à %s de réparer son vehicule pour $%d .",giveplayer,money);
  150. SendClientMessage(playerid, COLOR_WHITE, string);
  151. format(string, sizeof(string), "* Mécanicien %s vous propose de réparer le vehicule pour $%d, (tapez /accepter reparation) pour accepter.",sendername,money);
  152. SendClientMessage(playa, COLOR_WHITE, string);
  153. RepairOffer[playa] = playerid;
  154. RepairPrice[playa] = money;
  155. }
  156. else
  157. {
  158. SendClientMessage(playerid, COLOR_GREY, " Ce joueur n'est pas vers vous ou dans la voiture.");
  159. }
  160. }
  161. }
  162. else
  163. {
  164. SendClientMessage(playerid, COLOR_GREY, " Ce joueur est hors-ligne.");
  165. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement