Advertisement
Guest User

Luby

a guest
Jan 6th, 2008
628
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.50 KB | None | 0 0
  1. // Luby's SA-MP to MTA Converter 2.0v 2008
  2. // GTAMScripting.info
  3.  
  4. // To use : Paste your code in ToSave function, compile it and run as gamemode :D
  5.  
  6. #include <file>
  7. #include <float>
  8. #include <string>
  9.  
  10. native format(output[], len, const format[], {Float,_}:...);
  11.  
  12. // Change this three lines <<<<<<<<<
  13. #define MAP_NAME "MTA.map"
  14.  
  15. #define YOU "You"
  16.  
  17. #define YOUR_MOD "MOD"
  18. // And leave others <<<<<<<<<<
  19.  
  20. main(){}
  21. native print(str[]);
  22. forward OnGameModeInit();
  23. public OnGameModeInit(){
  24. fremove(MAP_NAME);
  25. new File:fhandle;
  26. fhandle = fopen(MAP_NAME, io_append);
  27. fwrite(fhandle, "<map mod=\""YOUR_MOD"\" author=\""YOU"\" version=\"1.0\">\r\n");
  28. fclose(fhandle);
  29. print("Please wait ...");
  30. if(ToSave()){
  31. print("Done!");
  32. new File:fhandle2;
  33. fhandle2 = fopen(MAP_NAME, io_append);
  34. fwrite(fhandle2, "</map>");
  35. fclose(fhandle2);
  36. }
  37. return 1;
  38. }
  39.  
  40. ToSave(){
  41. // Don't change ANYTHING above this line !
  42.  
  43. // Put there your objects and vehicles written in Pawn.
  44.  
  45.  
  46.  
  47. // Don't change ANYTHING below this line !
  48. return 1;
  49. }
  50.  
  51. stock CreateObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ){
  52. new str[256];
  53. format(str,256,"<object model=\"%d\" posX=\"%f\" posY=\"%f\" posZ=\"%f\" rotX=\"%f\" rotY=\"%f\" rotZ=\"%f\" /> <!-- Generated by Luby's SA-MP to MTA Converter --> \r\n",modelid, X, Y, Z, rX, rY, rZ);
  54. new File:fhandle;
  55. fhandle = fopen(MAP_NAME, io_append);
  56. fwrite(fhandle, str);
  57. fclose(fhandle);
  58. return true;
  59. }
  60.  
  61. stock AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2){
  62. new str[256];
  63. format(str,256,"<vehicle model=\"%d\" posX=\"%f\" posY=\"%f\" posZ=\"%f\" rotX=\"0.0\" rotY=\"0.0\" rotZ=\"%f\" color=\"%d %d 0 0\"/> <!-- Generated by Luby's SA-MP to MTA Converter --> \r\n",modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2);
  64. new File:fhandle;
  65. fhandle = fopen(MAP_NAME, io_append);
  66. fwrite(fhandle, str);
  67. fclose(fhandle);
  68. return true;
  69. }
  70.  
  71. stock AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay){
  72. #pragma unused color1
  73. #pragma unused color2
  74. #pragma unused respawn_delay
  75. new str[256];
  76. format(str,256,"<vehicle model=\"%d\" posX=\"%f\" posY=\"%f\" posZ=\"%f\" rotX=\"0.0\" rotY=\"0.0\" rotZ=\"%f\" color=\"%d %d 0 0\"/> <!-- Generated by Luby's SA-MP to MTA Converter --> \r\n",modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2);
  77. new File:fhandle;
  78. fhandle = fopen(MAP_NAME, io_append);
  79. fwrite(fhandle, str);
  80. fclose(fhandle);
  81. return true;
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement