Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.40 KB | None | 0 0
  1. if(dialogid == DIALOG_NOSTOCK)
  2. {
  3. if(response)
  4. {
  5. hidePlayerDialog(playerid);
  6. BuyCar[playerid] = 0;
  7. }
  8. return 1;
  9. }
  10. if(dialogid == DIALOG_CARBUY5)
  11. {
  12. if(response)
  13. {
  14. new num = BuyCar[playerid];
  15. if(GetPlayerCash(playerid) >= Stock[num][vPrice])
  16. {
  17. if(Stock[num][vStock] > 0)
  18. {
  19. InsertCar(playerid,num,0);
  20. }
  21. else
  22. {
  23. new stringg[MAX_STRING];
  24. format(stringg,sizeof(stringg),"Aceasta masina nu mai este disponibila in Dealership. Stoc epuizat.\nYou can't buy this vehicle from the dealership. Out of stock.");
  25. ShowPlayerDialog(playerid, DIALOG_NOSTOCK, DIALOG_STYLE_MSGBOX, "Out of stock", stringg, "Close","");
  26. }
  27. }
  28. else return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to purchase this vehicle.");
  29. }
  30. else
  31. {
  32. BuyCar[playerid] = -1;
  33. ShowPlayerDialog(playerid,DIALOG_CARBUY, DIALOG_STYLE_LIST, "Buy a car", "Cheap cars\nRegular cars\nExpensive cars\nPremium cars", "Select", "Close");
  34. }
  35. }
  36. if(dialogid == DIALOG_CARBUY2)
  37. {
  38. if(response)
  39. {
  40. new num = listitem + 1;
  41. BuyCar[playerid] = num;
  42. new string33[256], stringtitle[256];
  43. format(stringtitle, sizeof(stringtitle), "%s ($%s) - %d available", Stock[num][vName], FormatNumber(Stock[num][vPrice]), Stock[num][vStock]);
  44. format(string33, sizeof(string33), "Vehicle name: %s\nVehicle price: %s\nNumber of cars available: %d\nTop speed: %s km/h", Stock[num][vName], FormatNumber(Stock[num][vPrice]), Stock[num][vStock], FormatNumber(Stock[num][vSpeed]));
  45. ShowPlayerDialog(playerid, DIALOG_CARBUY5, DIALOG_STYLE_MSGBOX, stringtitle, string33, "Buy car", "Back");
  46. }
  47. return 1;
  48. }
  49. if(dialogid == DIALOG_CARBUY3)
  50. {
  51. if(response)
  52. {
  53. new cheapcars;
  54. for(new xf = 0; xf < MAX_PERSONAL_CARS; xf++)
  55. {
  56. if(Stock[xf][vPrice] > 0 && Stock[xf][vPrice] <= 7000000)
  57. {
  58. cheapcars = xf;
  59. }
  60. }
  61. new num = listitem + cheapcars + 1;
  62. BuyCar[playerid] = num;
  63. new string33[256], stringtitle[256];
  64. format(stringtitle, sizeof(stringtitle), "%s ($%s) - %d available", Stock[num][vName], FormatNumber(Stock[num][vPrice]), Stock[num][vStock]);
  65. format(string33, sizeof(string33), "Vehicle name: %s\nVehicle price: %s\nNumber of cars available: %d\nTop speed: %s km/h", Stock[num][vName], FormatNumber(Stock[num][vPrice]), Stock[num][vStock], FormatNumber(Stock[num][vSpeed]));
  66. ShowPlayerDialog(playerid, DIALOG_CARBUY5, DIALOG_STYLE_MSGBOX, stringtitle, string33, "Buy car", "Back");
  67. }
  68. return 1;
  69. }
  70. if(dialogid == DIALOG_CARBUY4)
  71. {
  72. if(response)
  73. {
  74. new regcheapcars;
  75. for(new xf = 0; xf < MAX_PERSONAL_CARS; xf++)
  76. {
  77. if(Stock[xf][vPrice] > 7000000 && Stock[xf][vPrice] <= 19999999)
  78. {
  79. regcheapcars = xf;
  80. }
  81. }
  82. new num = listitem + regcheapcars + 1;
  83. BuyCar[playerid] = num;
  84. new string33[256], stringtitle[256];
  85. format(stringtitle, sizeof(stringtitle), "%s ($%s) - %d available", Stock[num][vName], FormatNumber(Stock[num][vPrice]), Stock[num][vStock]);
  86. format(string33, sizeof(string33), "Vehicle name: %s\nVehicle price: %s\nNumber of cars available: %d\nTop speed: %s km/h", Stock[num][vName], FormatNumber(Stock[num][vPrice]), Stock[num][vStock], FormatNumber(Stock[num][vSpeed]));
  87. ShowPlayerDialog(playerid, DIALOG_CARBUY5, DIALOG_STYLE_MSGBOX, stringtitle, string33, "Buy car", "Back");
  88. }
  89. return 1;
  90. }
  91. if(dialogid == DIALOG_CARBUY)
  92. {
  93. if(response)
  94. {
  95. if(listitem == 0)
  96. {
  97. new stringzz[MAX_STRING],stringy[MAX_STRING];
  98. for(new xf = 0; xf < MAX_PERSONAL_CARS; xf++)
  99. {
  100. if(Stock[xf][vPrice] > 0 && Stock[xf][vPrice] <= 7000000)
  101. {
  102. format(stringy, sizeof(stringy), "%s ($%s) - %d in stock\n", Stock[xf][vName], FormatNumber(Stock[xf][vPrice]), Stock[xf][vStock]);
  103. strcat(stringzz,stringy);
  104. }
  105. }
  106. ShowPlayerDialog(playerid, DIALOG_CARBUY2, DIALOG_STYLE_LIST, "Buy a car", stringzz, "Select", "Close");
  107. }
  108. if(listitem == 1)
  109. {
  110. new stringzz[MAX_STRING],stringy[MAX_STRING];
  111. for(new xf = 0; xf < MAX_PERSONAL_CARS; xf++)
  112. {
  113. if(Stock[xf][vPrice] > 7000000 && Stock[xf][vPrice] <= 19999999)
  114. {
  115. format(stringy, sizeof(stringy), "%s ($%s) - %d in stock\n", Stock[xf][vName], FormatNumber(Stock[xf][vPrice]), Stock[xf][vStock]);
  116. strcat(stringzz,stringy);
  117. }
  118. }
  119. ShowPlayerDialog(playerid, DIALOG_CARBUY3, DIALOG_STYLE_LIST, "Buy a car", stringzz, "Select", "Close");
  120. }
  121. if(listitem == 2)
  122. {
  123. new stringzz[MAX_STRING],stringy[MAX_STRING];
  124. for(new xf = 0; xf < MAX_PERSONAL_CARS; xf++)
  125. {
  126. if(Stock[xf][vPrice] >= 20000000 && Stock[xf][vPrice] < 70000000)
  127. {
  128. format(stringy, sizeof(stringy), "%s ($%s) - %d in stock\n", Stock[xf][vName], FormatNumber(Stock[xf][vPrice]), Stock[xf][vStock]);
  129. strcat(stringzz,stringy);
  130. }
  131. }
  132. ShowPlayerDialog(playerid, DIALOG_CARBUY4, DIALOG_STYLE_LIST, "Buy a car", stringzz, "Select", "Close");
  133. }
  134. if(listitem == 3)
  135. {
  136. new string2[MAX_STRING];
  137. format(string2,sizeof(string2),"Sparrow - 220 premium points\nHotring Racer B - 250 premium points\nHotring Racer A - 250 premium points\nVortex - 250 premium points\nHotring Racer - 250 premium points\nMaverick - 300 premium points");
  138. ShowPlayerDialog(playerid, DIALOG_CARBUY8, DIALOG_STYLE_LIST, "Buy a car", string2, "Select", "Close");
  139. }
  140. }
  141. return 1;
  142. }
  143. if(dialogid == DIALOG_CARBUY8)
  144. {
  145. if(response)
  146. {
  147. new num = listitem + 98;
  148. BuyCar[playerid] = num;
  149. new string33[256], stringtitle[256];
  150. format(stringtitle, sizeof(stringtitle), "%s ($%s) - %d available", Stock[num][vName], FormatNumber(Stock[num][vPrice]), Stock[num][vStock]);
  151. format(string33, sizeof(string33), "Vehicle name: %s\nVehicle price: %s\nNumber of cars available: %d\nTop speed: %s km/h", Stock[num][vName], FormatNumber(Stock[num][vPrice]), Stock[num][vStock], FormatNumber(Stock[num][vSpeed]));
  152. ShowPlayerDialog(playerid, DIALOG_CARBUY9, DIALOG_STYLE_MSGBOX, stringtitle, string33, "Buy car", "Back");
  153. }
  154. return 1;
  155. }
  156. if(dialogid == DIALOG_CARBUY9)
  157. {
  158. if(response)
  159. {
  160. new num = BuyCar[playerid],price;
  161. if(num == 98) price = 220;
  162. if(num == 99) price = 250;
  163. if(num == 100) price = 250;
  164. if(num == 101) price = 250;
  165. if(num == 102) price = 250;
  166. if(num == 103) price = 300;
  167. if(PlayerInfo[playerid][pPremiumPoints] >= price)
  168. {
  169. if(Stock[num][vStock] > 0)
  170. {
  171. InsertCar(playerid,num,1);
  172. }
  173. else
  174. {
  175. new stringg[MAX_STRING];
  176. format(stringg,sizeof(stringg),"Aceasta masina nu mai este disponibila in Dealership. Stoc epuizat.\nYou can't buy this vehicle from the dealership. Out of stock.");
  177. ShowPlayerDialog(playerid, DIALOG_NOSTOCK, DIALOG_STYLE_MSGBOX, "Out of stock", stringg, "Close","");
  178. }
  179. }
  180. else return SS(playerid, COLOR_WHITE, "Nu ai suficiente puncte premium. Detalii despre punctele premium pe 127.0.0.1", "You don't have enough premium points. Details about premium points here 127.0.0.1");
  181. }
  182. else
  183. {
  184. BuyCar[playerid] = -1;
  185. ShowPlayerDialog(playerid,DIALOG_CARBUY, DIALOG_STYLE_LIST, "Buy a car", "Cheap cars\nRegular cars\nExpensive cars\nPremium cars", "Select", "Close");
  186. }
  187. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement