dayzcars.pwn 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. YCMD:420carexport(playerid, arg[], help)
  2. {
  3. if(help)
  4. {
  5. SendClientMessage(playerid, STEALTH_ORANGE, "______________________________________________");
  6. SendClientMessage(playerid, STEALTH_GREEN, "Export current vehicle to 420 DayZ format.");
  7. return 1;
  8. }
  9. MapOpenCheck();
  10. VehicleCheck(playerid);
  11. // Ask for a map name
  12. inline Export420Car(epid, edialogid, eresponse, elistitem, string:etext[])
  13. {
  14. #pragma unused elistitem, edialogid, epid
  15. if(eresponse)
  16. {
  17. // Was a map name supplied ?
  18. if(!isnull(etext))
  19. {
  20. new exportcar[256];
  21. // Check map name length
  22. if(strlen(etext) >= 20)
  23. {
  24. SendClientMessage(playerid, STEALTH_ORANGE, "______________________________________________");
  25. SendClientMessage(playerid, STEALTH_YELLOW, "Choose a shorter car name to export to...");
  26. return 1;
  27. }
  28. // Format the output name
  29. format(exportcar, sizeof(exportcar), "tstudio/420ExportCars/%s.txt", etext);
  30. // Map exists ask to remove
  31. if(fexist(exportcar))
  32. {
  33. inline RemoveCar(rpid, rdialogid, rresponse, rlistitem, string:rtext[])
  34. {
  35. #pragma unused rlistitem, rdialogid, rpid, rtext
  36. // Remove map and export
  37. if(rresponse)
  38. {
  39. fremove(exportcar);
  40. DayzCarExport(playerid, exportcar);
  41. }
  42. }
  43. Dialog_ShowCallback(playerid, using inline RemoveCar, DIALOG_STYLE_MSGBOX, "Texture Studio (420 Car Export)", "A export exists with this name replace?", "Ok", "Cancel");
  44. }
  45. // We can start the export
  46. else DayzCarExport(playerid, exportcar);
  47. }
  48. else
  49. {
  50. SendClientMessage(playerid, STEALTH_ORANGE, "______________________________________________");
  51. SendClientMessage(playerid, STEALTH_YELLOW, "You can't export a 420 DayZ car with no name");
  52. Dialog_ShowCallback(playerid, using inline Export420Car, DIALOG_STYLE_INPUT, "Texture Studio (420 Car Export)", "Enter a export car name", "Ok", "Cancel");
  53. }
  54. }
  55. }
  56. Dialog_ShowCallback(playerid, using inline Export420Car, DIALOG_STYLE_INPUT, "Texture Studio (420 Car Export)", "Enter a export car name", "Ok", "Cancel");
  57. return 1;
  58. }
  59. /*
  60. {
  61. VEHICLE_TYPE_LOCKED, 468, 3, 135, 135, -1, 1, 0, 0, 0, 4.0,
  62. { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  63. { 3026, 3026, 19477, 18634, 18702, INVALID_OBJECT_ID, INVALID_OBJECT_ID, INVALID_OBJECT_ID, INVALID_OBJECT_ID, INVALID_OBJECT_ID },
  64. {
  65. 2644, 0, 0, 0, 0, 0,
  66. 2644, 0, 0, 0, 0, 0,
  67. 0, 0, 0, 0, 0, 0,
  68. 0, 0, 0, 0, 0, 0,
  69. 0, 0, 0, 0, 0, 0,
  70. 0, 0, 0, 0, 0, 0,
  71. 0, 0, 0, 0, 0, 0,
  72. 0, 0, 0, 0, 0, 0,
  73. 0, 0, 0, 0, 0, 0,
  74. 0, 0, 0, 0, 0, 0
  75. },
  76. {
  77. 0, 0, 0, 0, 0, 0,
  78. 0, 0, 0, 0, 0, 0,
  79. 0, 0, 0, 0, 0, 0,
  80. 0, 0, 0, 0, 0, 0,
  81. 0, 0, 0, 0, 0, 0,
  82. 0, 0, 0, 0, 0, 0,
  83. 0, 0, 0, 0, 0, 0,
  84. 0, 0, 0, 0, 0, 0,
  85. 0, 0, 0, 0, 0, 0,
  86. 0, 0, 0, 0, 0, 0
  87. },
  88. { 0,0,1,0,0,0,0,0,0,0 },
  89. { "none|none|Haze |none|none|none|none|none|none|none" },
  90. { 0,0,0,0,0,0,0,0,0,0 },
  91. { 0,0,130,0,0,0,0,0,0,0 },
  92. { 0,0,0,0,0,0,0,0,0,0 },
  93. { 0,0,-16715022,0,0,0,0,0,0,0 },
  94. { 0,0,0,0,0,0,0,0,0,0 },
  95. { 0,0,0,0,0,0,0,0,0,0 },
  96. { 0,0,25,0,0,0,0,0,0,0 },
  97. { -0.100000, 0.089000, 0.085000, -0.128000, 0.108000, 0.0, 0.0, 0.0, 0.0, 0.0 },
  98. { 0.298000, 0.298000, 0.629000, -0.349000, -0.759000, 0.0, 0.0, 0.0, 0.0, 0.0 },
  99. { -0.008000, -0.008000, -0.717000, 0.200000, -1.429000, 0.0, 0.0, 0.0, 0.0, 0.0 },
  100. { 180.000000, 180.000000, -10.000000, 12.899000, 0.000000, 0.0, 0.0, 0.0, 0.0, 0.0 },
  101. { 90.000000, 90.000000, 1.000000, 5.000000, 0.000000, 0.0, 0.0, 0.0, 0.0, 0.0 },
  102. { 450.000000, 270.000000, 363.299011, 176.000000, 0.000000, 0.0, 0.0, 0.0, 0.0, 0.0 }
  103. }
  104. */
  105. static DayzCarExport(playerid, exportcar)
  106. {
  107. new File:f = f_open(exportcar, io_write);
  108. }