Advertisement
Guest User

Dialog Garage

a guest
Feb 5th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.54 KB | None | 0 0
  1. case DIALOG_GARAGE: {
  2. if(!response) return 1;
  3. sVehicle[5][playerid] = sVehicle[listitem][playerid];
  4. if(CarInfo[sVehicle[listitem][playerid]][Spawned] != 0) ShowPlayerDialog(playerid, DIALOG_GARAGE1, DIALOG_STYLE_LIST, "Options", "Information\nLocate\nTow\nDespawn\nDebug\nSell", "Select", "Back");
  5. else if(CarInfo[sVehicle[listitem][playerid]][Spawned] == 0) ShowPlayerDialog(playerid, DIALOG_GARAGE1, DIALOG_STYLE_LIST, "Options", "Information\nLocate\nTow\nSpawn - park place\nDebug\nSell", "Select", "Back");
  6. }
  7.  
  8. case DIALOG_GARAGE1: {
  9. if(!response) return ShowVehiclesMenu(playerid);
  10. new vsid = sVehicle[5][playerid];
  11. switch(listitem) {
  12. case 0: { // info
  13. new locktext[6];
  14. if(CarInfo[vsid][cLock] > 0) {locktext = "Yes";}
  15. else {locktext = "No";}
  16. SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
  17. format(string, sizeof(string), "Model:[%s] Value:[$%s] Locked:[%s] Color1:[%d] Color2:[%d]", aVehicleNames[CarInfo[vsid][cModel]-400], FormatNumber(CarInfo[vsid][cValue]), locktext, CarInfo[vsid][cColorOne], CarInfo[vsid][cColorTwo]);
  18. SendClientMessage(playerid, COLOR_GREY,string);
  19. format(string, sizeof(string), "Kilometers:[%.2f] Insurance:[No] Insurance price:[$51] ID:[%d]", CarInfo[vsid][KM], CarInfo[vsid][Spawned]);
  20. SendClientMessage(playerid, COLOR_GREY, string);
  21. SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
  22. }
  23. case 1: { // find
  24. if(CarInfo[vsid][Spawned] == 0) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Your car isn't spawned!");
  25. if(CP[playerid] != 0) return SendClientMessage(playerid, COLOR_GOLD, "Ai deja un punct rosu activ. Foloseste comanda '/cancel checkpoint' pentru a renunta la el.");
  26. new Float:vehx, Float:vehy, Float:vehz;
  27. GetVehiclePos(CarInfo[vsid][Spawned], vehx, vehy, vehz);
  28. SetPlayerCheckpoint(playerid, vehx, vehy, vehz, 3.0);
  29. new szZone[128];
  30. GetPlayer3DZone2(vehx, vehy, vehz, szZone, sizeof(szZone));
  31. format(string, sizeof(string), "{FFB870}Your %s has been located near %s.", aVehicleNames[CarInfo[vsid][cModel]-400], szZone);
  32. SendClientMessage(playerid, COLOR_WHITE, string);
  33. CP[playerid] = 53;
  34. }
  35. case 2: { // tow
  36. if(CarInfo[vsid][Spawned] == 0) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Your car isn't spawned!");
  37. if(PlayerInfo[playerid][pCash] < 500) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Your don't have $500!");
  38. if(IsVehicleOccupied(CarInfo[vsid][Spawned])) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Vehicle is ocuppied!");
  39. SetTunning(vsid);
  40. SetVehicleToRespawn(CarInfo[vsid][Spawned]);
  41. GivePlayerCash(playerid, -500);
  42. SBizzInfo[5][sbTill] += 500;
  43. mysql_format(SQL, string,sizeof(string),"UPDATE sbizz SET Till = %d WHERE ID = %d",SBizzInfo[5][sbTill],5);
  44. mysql_tquery(SQL, string, "", "");
  45. format(string, sizeof(string), "{FFB870}Your %s is now at its parking place.", aVehicleNames[CarInfo[vsid][cModel]-400]);
  46. SendClientMessage(playerid, COLOR_WHITE, string);
  47. }
  48. case 3: { // despawn & spawn
  49. if(CarInfo[vsid][Spawned] == 0) {
  50. CarInfo[vsid][Spawned] = CreateVehicle(CarInfo[vsid][cModel],CarInfo[vsid][cLocationx],CarInfo[vsid][cLocationy],CarInfo[vsid][cLocationz],CarInfo[vsid][cAngle],CarInfo[vsid][cColorOne],CarInfo[vsid][cColorTwo],-1);
  51. SetTunning(vsid);
  52. if(CarInfo[PlayerInfo[playerid][pCarKey1]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][0] = 1800;
  53. else if(CarInfo[PlayerInfo[playerid][pCarKey2]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][1] = 1800;
  54. else if(CarInfo[PlayerInfo[playerid][pCarKey3]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][2] = 1800;
  55. else if(CarInfo[PlayerInfo[playerid][pCarKey4]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][3] = 1800;
  56. else if(CarInfo[PlayerInfo[playerid][pCarKey5]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][4] = 1800;
  57. format(string, sizeof(string), "{FFB870}Your %s has been spawned.", aVehicleNames[CarInfo[vsid][cModel]-400]);
  58. SendClientMessage(playerid, COLOR_WHITE, string);
  59. mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Spawned='%d' WHERE ID=%d", CarInfo[vsid][Spawned], vsid);
  60. mysql_tquery(SQL, string, "", "");
  61. }
  62. else {
  63. if(IsVehicleOccupied(CarInfo[vsid][Spawned])) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Vehicle is ocuppied!");
  64. if(CarInfo[PlayerInfo[playerid][pCarKey1]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][0] = -1;
  65. else if(CarInfo[PlayerInfo[playerid][pCarKey2]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][1] = -1;
  66. else if(CarInfo[PlayerInfo[playerid][pCarKey3]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][2] = -1;
  67. else if(CarInfo[PlayerInfo[playerid][pCarKey4]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][3] = -1;
  68. else if(CarInfo[PlayerInfo[playerid][pCarKey5]][Spawned] == CarInfo[vsid][Spawned] && vsid != 0) DespawnCar[playerid][4] = -1;
  69. DestroyVehicle(CarInfo[vsid][Spawned]);
  70. CarInfo[vsid][Spawned] = 0;
  71. format(string, sizeof(string), "{FFB870}Your %s has been despawned.", aVehicleNames[CarInfo[vsid][cModel]-400]);
  72. SendClientMessage(playerid, COLOR_WHITE, string);
  73. mysql_format(SQL, string, sizeof(string), "UPDATE cars SET Spawned='%d' WHERE ID=%d", CarInfo[vsid][Spawned], vsid);
  74. mysql_tquery(SQL, string, "", "");
  75. }
  76. }
  77. case 4: { // Debug
  78. if(CarInfo[vsid][Spawned] == 0) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Your car isn't spawned!");
  79. if(IsVehicleOccupied(CarInfo[vsid][Spawned])) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Vehicle is ocuppied!");
  80. format(string, sizeof(string), "{FFB870}You unstuck your %s, it is now near LV Airport. Please park it (/park) in a better place.", aVehicleNames[CarInfo[vsid][cModel]-400]);
  81. SendClientMessage(playerid, COLOR_WHITE, string);
  82. SetVehiclePos(CarInfo[vsid][Spawned], 1688.9471,1306.3896,10.9159);
  83. SetVehicleZAngle(CarInfo[vsid][Spawned], 359.3103);
  84. }
  85. case 5: { // sell
  86. if(CarInfo[vsid][Spawned] == 0) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Your car isn't spawned!");
  87. if(CarInfo[vsid][Spawned] != GetPlayerVehicleID(playerid)) return SendClientMessage(playerid, COLOR_YELLOW2, "Eroare: Nu esti in vehiculul tau personal");
  88. if(CarInfo[vsid][cSpecial] == 1) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Acces denined!");
  89. if(!PlayerToPoint(5.0,playerid,321.1830,-1520.7961,36.0391)) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}{FFFFCC}Eroare: Trebuie sa fii la distribuitorul de vehicule.");
  90. if(PlayerInfo[playerid][pPinLogged] == 0 && strlen(PlayerInfo[playerid][pPin]) != 1) return SendClientMessage(playerid, COLOR_YELLOW2, "Eroare: Contul tau este blocat. Scrie /pin pentru a il debloca si pentru a folosi aceasta comanda.");
  91. new value;
  92. value = floatround((CarInfo[vsid][cValue] * 7) / 10);
  93. format(string, sizeof(string), "\tRodeo Dealership :\n- Are you sure you want to sell your %s for %s$ ?",aVehicleNames[CarInfo[vsid][cModel]-400],FormatNumber(value));
  94. ShowPlayerDialog(playerid, DIALOG_SELLCAR, DIALOG_STYLE_MSGBOX, "Rodeo Dealership Office", string, "Yes", "No");
  95. PlayerSellCar[playerid] = vsid;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement