Advertisement
Guest User

Untitled

a guest
Feb 13th, 2019
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.86 KB | None | 0 0
  1. case DIALOG_GARAGE: {
  2. if(!response) return 1;
  3. new idd;
  4. if(PlayerInfo[playerid][pCarKey][listitem] == 0) return 1;
  5. else idd = PlayerInfo[playerid][pCarKey][listitem];
  6. sVehicle[5][playerid] = idd;
  7. SetPVarInt(playerid, "VehicleSlot", listitem);
  8. if(CarInfo[idd][Spawned] != 0) strcat(string, "Vehicle Info\nFind Vehicle\nTow Vehicle (/park)\nTow Vehicle (last known location)\nDespawn\nDebug\nSell Vehicle\nBuy Insurance\nUpgrade to VIP Vehicle - {FFFF00}200{FFFFFF} puncte premium{FFFFFF}\n{FF0000}Remove tuning");
  9. else if(CarInfo[idd][Spawned] == 0) strcat(string, "Vehicle Info\nFind Vehicle\nTow Vehicle (/park)\nTow Vehicle (last known location)\nSpawn vehicle\nDebug\nSell Vehicle\nBuy Insurance\nUpgrade to VIP Vehicle - {FFFF00}200{FFFFFF} puncte premium{FFFFFF}\n{FF0000}Remove tuning");
  10. if(CarInfo[idd][Confiscated] == 1) strcat(string, "\n{FFFFFF}Pay fine to TTC");
  11. ShowPlayerDialog(playerid, DIALOG_GARAGE1, DIALOG_STYLE_LIST, "Options", string, "Ok", "Back");
  12. }
  13. case DIALOG_GARAGE1: {
  14. if(!response) return ShowPlayerVehicle(playerid);
  15. new vsid = sVehicle[5][playerid];
  16. switch(listitem) {
  17. case 0: { // info
  18. new locktext[15];
  19. if(CarInfo[vsid][cLock] > 0) {locktext = "Locked";}
  20. else {locktext = "Unlocked";}
  21. format(string, sizeof(string), "Model: %s (%d)\nStatus: %s\nColor 1: %d\nColor 2: %d\nOdometer: %.2f km\nInsurance points: %d\nInsurance tax: $%s", aVehicleNames[CarInfo[vsid][cModel]-400], CarInfo[vsid][Spawned], locktext, CarInfo[vsid][cColorOne], CarInfo[vsid][cColorTwo], CarInfo[vsid][KM], CarInfo[vsid][cPoints], FormatNumber(CarInfo[vsid][cTax]));
  22. ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Vehicle info", string, "Close", "");
  23. }
  24. case 1: { // find
  25. if(CarInfo[vsid][Spawned] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Vehiculul tau nu este spawnat!");
  26. if(CP[playerid] != 0) return ShowPlayerDialog(playerid, DIALOG_CHECKPOINT, DIALOG_STYLE_MSGBOX, "Checkpoint", "Ai deja un checkpoint activ.\nDoresti sa-l anulezi? Daca da, apasa pe 'Ok'.", "Ok", "Exit");
  27. new Float:vehx, Float:vehy, Float:vehz;
  28. GetVehiclePos(CarInfo[vsid][Spawned], vehx, vehy, vehz);
  29. SetPlayerCheckpointEx(playerid, vehx, vehy, vehz, 3.0);
  30. new szZone[128];
  31. GetPlayer3DZone2(vehx, vehy, vehz, szZone, sizeof(szZone));
  32. format(string, sizeof(string), "[Manage vehicle] Your vehicle, %s, has been located and in %s.", aVehicleNames[CarInfo[vsid][cModel]-400], szZone);
  33. SCM(playerid, COLOR_GOLD, string);
  34. CP[playerid] = 53;
  35. }
  36. case 2: { // tow
  37. if(GetPlayerCash(playerid) < 1000) return SCM(playerid, COLOR_GREY, "Nu ai $1000!");
  38. if(IsVehicleOccupied(CarInfo[vsid][Spawned])) return SCM(playerid, COLOR_LGREEN, "Eroare: Vehiculul tau este ocupat!");
  39. if(CarInfo[vsid][Confiscated] == 1) return SCM(playerid, -1, "Acest vehicul este confiscat deoarece a fost parcat neregulamentar! Plateste amenda (ultimul rand din meniu).");
  40. if(CarInfo[vsid][Spawned] == 0) SpawnPlayerCar(vsid);
  41. else {
  42. if(IsAttached(CarInfo[vsid][Spawned])) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti folosi aceasta functie momentan!");
  43. SetVehicleToRespawn(CarInfo[vsid][Spawned]);
  44. }
  45. SetTunning(vsid);
  46. GivePlayerCash(playerid, -1000);
  47. BizzInfo[19][bBalance] += 1000;
  48. mysql_format(SQL, string, sizeof(string), "UPDATE bizz SET Till = %d WHERE ID = %d",BizzInfo[19][bBalance],30);
  49. mysql_tquery(SQL, string, "", "");
  50. format(string, sizeof(string), "[Manage vehicle] Your vehicle, %s, has been respawned.", aVehicleNames[CarInfo[vsid][cModel]-400]);
  51. SCM(playerid, COLOR_GOLD, string);
  52. }
  53. case 3: { // tow
  54. if(IsAttached(CarInfo[vsid][Spawned])) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti folosi aceasta functie momentan!");
  55. if(GetPlayerCash(playerid) < 1000) return SCM(playerid, COLOR_GREY, "Nu ai $1000!");
  56. if(IsVehicleOccupied(CarInfo[vsid][Spawned])) return SCM(playerid, COLOR_LGREEN, "Eroare: Vehiculul tau este ocupat!");
  57.  
  58. if(CarInfo[vsid][Spawned] != 0) {
  59. SetVehiclePosEx(playerid, CarInfo[vsid][Spawned], CarInfo[vsid][cLastPos][0], CarInfo[vsid][cLastPos][1], CarInfo[vsid][cLastPos][2]);
  60. }
  61. else SpawnPlayerCar(vsid);
  62. GivePlayerCash(playerid, -1000);
  63. BizzInfo[19][bBalance] += 1000;
  64. mysql_format(SQL, string, sizeof(string), "UPDATE bizz SET Till = %d WHERE ID = %d",BizzInfo[19][bBalance],30);
  65. mysql_tquery(SQL, string, "", "");
  66. format(string, sizeof(string), "[Manage vehicle] Your vehicle, %s, has been respawned.", aVehicleNames[CarInfo[vsid][cModel]-400]);
  67. SCM(playerid, COLOR_GOLD, string);
  68. }
  69. case 4: { // despawn & spawn
  70. if(CarInfo[vsid][Spawned] == 0) {
  71. if(CarInfo[vsid][Confiscated] == 1) return SCM(playerid, -1, "Acest vehicul este confiscat deoarece a fost parcat neregulamentar! Plateste amenda (ultimul rand din meniu).");
  72. SpawnPlayerCar(vsid);
  73. }
  74. else {
  75. if(IsAttached(CarInfo[vsid][Spawned])) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti folosi aceasta functie momentan!");
  76. if(IsVehicleOccupied(CarInfo[vsid][Spawned])) return SCM(playerid, COLOR_LGREEN, "Eroare: Vehiculul tau este ocupat!");
  77. DestroyPlayerCar(vsid);
  78. format(string, sizeof(string), "[Manage vehicle] Your vehicle, %s, has been despawned.", aVehicleNames[CarInfo[vsid][cModel]-400]);
  79. SCM(playerid, COLOR_GOLD, string);
  80. }
  81. }
  82. case 5: { // Debug
  83. if(CarInfo[vsid][Spawned] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Vehiculul tau nu este spawnat!");
  84. if(IsAttached(CarInfo[vsid][Spawned])) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti folosi aceasta functie momentan!");
  85. if(IsVehicleOccupied(CarInfo[vsid][Spawned])) return SCM(playerid, COLOR_LGREEN, "Eroare: Vehiculul tau este ocupat!");
  86. if(CP[playerid] != 0) return ShowPlayerDialog(playerid, DIALOG_CHECKPOINT, DIALOG_STYLE_MSGBOX, "Checkpoint", "Ai deja un checkpoint activ.\nDoresti sa-l anulezi? Daca da, apasa pe 'Ok'.", "Ok", "Exit");
  87. SetVehiclePosEx(playerid, CarInfo[vsid][Spawned], 1688.9471,1306.3896,10.9159);
  88. SetVehicleZAngleEx(CarInfo[vsid][Spawned], 359.3103);
  89. CP[playerid] = 53;
  90. if(IsAFLYCar(CarInfo[vsid][Spawned])) {
  91. format(string, sizeof(string), "Urmareste checkpoint-ul de pe mapa pentru a ajunge la vehiculul tau.", aVehicleNames[CarInfo[vsid][cModel]-400]);
  92. SCM(playerid, COLOR_YELLOW, string);
  93. SetVehiclePosEx(playerid, CarInfo[vsid][Spawned], -1649.1798, -159.0667, 17.3618);
  94. SetVehicleZAngleEx(CarInfo[vsid][Spawned], -44.1000);
  95. new randspawn = random(sizeof(HeliVehPos));
  96. SetVehiclePosEx(playerid, CarInfo[vsid][Spawned], HeliVehPos[randspawn][0], HeliVehPos[randspawn][1], HeliVehPos[randspawn][2]);
  97. SetVehicleZAngleEx(CarInfo[vsid][Spawned], 44.4000);
  98. SetPlayerCheckpointEx(playerid, HeliVehPos[randspawn][0], HeliVehPos[randspawn][1], HeliVehPos[randspawn][2], 5.0);
  99. return 1;
  100. }
  101. else if(IsABOATCar(CarInfo[vsid][Spawned])) {
  102. format(string, sizeof(string), "Urmareste checkpoint-ul de pe mapa pentru a ajunge la vehiculul tau.", aVehicleNames[CarInfo[vsid][cModel]-400]);
  103. SCM(playerid, COLOR_YELLOW, string);
  104. new randspawn = random(sizeof(BoatVehPos));
  105. SetVehiclePosEx(playerid, CarInfo[vsid][Spawned], BoatVehPos[randspawn][0], BoatVehPos[randspawn][1], BoatVehPos[randspawn][2]);
  106. SetVehicleZAngleEx(CarInfo[vsid][Spawned], -173.4001);
  107. SetPlayerCheckpointEx(playerid, BoatVehPos[randspawn][0], BoatVehPos[randspawn][1], BoatVehPos[randspawn][2], 5.0);
  108. return 1;
  109. }
  110. else {
  111. format(string, sizeof(string), "Urmareste checkpoint-ul de pe mapa pentru a ajunge la vehiculul tau.", aVehicleNames[CarInfo[vsid][cModel]-400]);
  112. SCM(playerid, COLOR_YELLOW, string);
  113. new randspawn = random(sizeof(DealerCarPos));
  114. SetVehiclePosEx(playerid, CarInfo[vsid][Spawned], DealerCarPos[randspawn][0], DealerCarPos[randspawn][1], DealerCarPos[randspawn][2]);
  115. SetVehicleZAngleEx(CarInfo[vsid][Spawned], -173.4001);
  116. SetPlayerCheckpointEx(playerid, DealerCarPos[randspawn][0], DealerCarPos[randspawn][1], DealerCarPos[randspawn][2], 5.0);
  117. return 1;
  118. }
  119. }
  120. case 6: { // sell
  121. if(TradeID[playerid] != -1) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti folosi aceasta comanda atata timp cat esti implicat intr-o afacere!");
  122. if(CarInfo[vsid][Spawned] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Vehiculul tau nu este spawnat!");
  123. //if(CarInfo[vsid][cSpecial] == 1) return SCM(playerid, -1, "Acces interzis!");
  124. if(!PlayerToPoint(5.0,playerid,326.9715,-1514.7264,36.0325)) return SCM(playerid, COLOR_WHITE, "Trebuie sa fii la dealership. Foloseste /gps pentru a afla unde este.");
  125. if(IsAttached(CarInfo[vsid][Spawned])) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti folosi aceasta functie momentan!");
  126. new value;
  127. value = CarPriceValid(CarInfo[vsid][cModel]) / 2;
  128. format(string, sizeof(string), "Esti sigur ca vrei sa-ti vinzi %s pentru %s$ ?",aVehicleNames[CarInfo[vsid][cModel]-400],FormatNumber(value));
  129. ShowPlayerDialog(playerid, DIALOG_SELLCAR, DIALOG_STYLE_MSGBOX, "Dealership", string, "Da", "Nu");
  130. PlayerSellCar[playerid] = vsid;
  131. if(CP[playerid] == 43 || CP[playerid] == 53) { CP[playerid] = 0; DisablePlayerCheckpointEx(playerid); }
  132. }
  133. case 7: ShowPlayerDialog(playerid, DIALOG_INSURANCE, DIALOG_STYLE_INPUT, "Asigurare", "Scrie mai jos cate puncte de asigurare vrei sa cumperi.\nPoti avea maxim 10 puncte iar pretul este in functie de taxele masinii.", "Cumpara", "Close");
  134. case 8: {
  135. if(CarInfo[vsid][Spawned] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Vehiculul tau nu este spawnat!");
  136. if(valid_vip_vehicle(CarInfo[vsid][cModel]) == 0) return SCM(playerid, COLOR_GREY, "Acest vehicul nu poate fi upgradat!");
  137. if(strlen(CarInfo[vsid][cText]) > 3) return SCM(playerid, -1, "Acest vehicul este deja unul VIP!");
  138. if(PlayerInfo[playerid][pPremiumPoints] < 200) return SCM(playerid, -1, "Nu ai destule puncte premium.");
  139. SetPVarInt(playerid, "VehicleID", vsid);
  140. ShowPlayerDialog(playerid, DIALOG_UPGRADEVIP, DIALOG_STYLE_MSGBOX, "Upgrade to VIP Vehicle", "Esti sigur ca vrei sa faci acest lucru?\nVei pierde 200 puncte premium.", "Da", "Nu");
  141. }
  142. case 9: { // rem tunn
  143. if(CarInfo[vsid][Spawned] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Vehiculul tau nu este spawnat!");
  144. new car = CarInfo[vsid][Spawned];
  145. if(CarInfo[vsid][mod0] != 0) RemoveVehicleComponent(car,CarInfo[vsid][mod0]);
  146. if(CarInfo[vsid][mod1] != 0) RemoveVehicleComponent(car,CarInfo[vsid][mod1]);
  147. if(CarInfo[vsid][mod2] != 0) RemoveVehicleComponent(car,CarInfo[vsid][mod2]);
  148. if(CarInfo[vsid][mod3] != 0) RemoveVehicleComponent(car,CarInfo[vsid][mod3]);
  149. if(CarInfo[vsid][mod4] != 0) RemoveVehicleComponent(car,CarInfo[vsid][mod4]);
  150. if(CarInfo[vsid][mod5] != 0) RemoveVehicleComponent(car,CarInfo[vsid][mod5]);
  151. if(CarInfo[vsid][mod6] != 0) RemoveVehicleComponent(car,CarInfo[vsid][mod6]);
  152. if(CarInfo[vsid][mod7] != 0) RemoveVehicleComponent(car,CarInfo[vsid][mod7]);
  153. if(CarInfo[vsid][mod8] != 0) RemoveVehicleComponent(car,CarInfo[vsid][mod8]);
  154. if(CarInfo[vsid][mod9] != 0) RemoveVehicleComponent(car,CarInfo[vsid][mod9]);
  155. if(CarInfo[vsid][mod10] != 0) RemoveVehicleComponent(car,CarInfo[vsid][mod10]);
  156. if(CarInfo[vsid][mod11] != 0) RemoveVehicleComponent(car,CarInfo[vsid][mod11]);
  157. if(CarInfo[vsid][mod12] != 0) RemoveVehicleComponent(car,CarInfo[vsid][mod12]);
  158. if(CarInfo[vsid][mod13] != 0) RemoveVehicleComponent(car,CarInfo[vsid][mod13]);
  159. CarInfo[vsid][mod0] = 0;
  160. CarInfo[vsid][mod1] = 0;
  161. CarInfo[vsid][mod2] = 0;
  162. CarInfo[vsid][mod3] = 0;
  163. CarInfo[vsid][mod4] = 0;
  164. CarInfo[vsid][mod5] = 0;
  165. CarInfo[vsid][mod6] = 0;
  166. CarInfo[vsid][mod7] = 0;
  167. CarInfo[vsid][mod8] = 0;
  168. CarInfo[vsid][mod9] = 0;
  169. CarInfo[vsid][mod10] = 0;
  170. CarInfo[vsid][mod11] = 0;
  171. CarInfo[vsid][mod12] = 0;
  172. CarInfo[vsid][mod13] = 0;
  173. CarInfo[vsid][paintjob] = 3;
  174. ChangeVehiclePaintjob(CarInfo[vsid][Spawned], 3);
  175. mysql_format(SQL, query, sizeof(query), "UPDATE cars SET mod0='%d' WHERE id=%d",CarInfo[vsid][mod0],vsid);
  176. mysql_tquery(SQL, query, "", "");
  177. mysql_format(SQL, query, sizeof(query), "UPDATE cars SET mod1='%d' WHERE id=%d",CarInfo[vsid][mod1],vsid);
  178. mysql_tquery(SQL, query, "", "");
  179. mysql_format(SQL, query, sizeof(query), "UPDATE cars SET mod2='%d' WHERE id=%d",CarInfo[vsid][mod2],vsid);
  180. mysql_tquery(SQL, query, "", "");
  181. mysql_format(SQL, query, sizeof(query), "UPDATE cars SET mod3='%d' WHERE id=%d",CarInfo[vsid][mod3],vsid);
  182. mysql_tquery(SQL, query, "", "");
  183. mysql_format(SQL, query, sizeof(query), "UPDATE cars SET mod4='%d' WHERE id=%d",CarInfo[vsid][mod4],vsid);
  184. mysql_tquery(SQL, query, "", "");
  185. mysql_format(SQL, query, sizeof(query), "UPDATE cars SET mod5='%d' WHERE id=%d",CarInfo[vsid][mod5],vsid);
  186. mysql_tquery(SQL, query, "", "");
  187. mysql_format(SQL, query, sizeof(query), "UPDATE cars SET mod6='%d' WHERE id=%d",CarInfo[vsid][mod6],vsid);
  188. mysql_tquery(SQL, query, "", "");
  189. mysql_format(SQL, query, sizeof(query), "UPDATE cars SET mod7='%d' WHERE id=%d",CarInfo[vsid][mod7],vsid);
  190. mysql_tquery(SQL, query, "", "");
  191. mysql_format(SQL, query, sizeof(query), "UPDATE cars SET mod8='%d' WHERE id=%d",CarInfo[vsid][mod8],vsid);
  192. mysql_tquery(SQL, query, "", "");
  193. mysql_format(SQL, query, sizeof(query), "UPDATE cars SET mod9='%d' WHERE id=%d",CarInfo[vsid][mod9],vsid);
  194. mysql_tquery(SQL, query, "", "");
  195. mysql_format(SQL, query, sizeof(query), "UPDATE cars SET mod10='%d' WHERE id=%d",CarInfo[vsid][mod10],vsid);
  196. mysql_tquery(SQL, query, "", "");
  197. mysql_format(SQL, query, sizeof(query), "UPDATE cars SET mod11='%d' WHERE id=%d",CarInfo[vsid][mod11],vsid);
  198. mysql_tquery(SQL, query, "", "");
  199. mysql_format(SQL, query, sizeof(query), "UPDATE cars SET mod12='%d' WHERE id=%d",CarInfo[vsid][mod12],vsid);
  200. mysql_tquery(SQL, query, "", "");
  201. mysql_format(SQL, query, sizeof(query), "UPDATE cars SET mod13='%d' WHERE id=%d",CarInfo[vsid][mod13],vsid);
  202. mysql_tquery(SQL, query, "", "");
  203. mysql_format(SQL, query, sizeof(query), "UPDATE cars SET paintjob='%d' WHERE id=%d",CarInfo[vsid][paintjob],vsid);
  204. mysql_tquery(SQL, query, "", "");
  205. }
  206. case 10: {
  207. if(CarInfo[vsid][Confiscated] == 0) return 1;
  208. if(GetPlayerCash(playerid) < CarInfo[vsid][cTax]) return SCM(playerid, -1, "Nu ai suma necesara de bani!");
  209. ShowPlayerDialog(playerid, DIALOG_TAX, DIALOG_STYLE_MSGBOX, "Plateste amenda",
  210. "Esti sigur ca vrei sa platesti amenda pentru parcarea neregulamentara?.", "Da", "Nu");
  211. }
  212. }
  213. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement