Guest User

Untitled

a guest
Aug 23rd, 2011
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. public OnGameModeInit()
  2. {
  3. if(!fexist("Pozicijos.txt"))
  4. {
  5. new File:Koordinates = fopen("Pozicijos.txt", io_write);
  6. fclose(Koordinates);
  7. }
  8. }
  9.  
  10. public OnPlayerCommandText(playerid, cmdtext[])
  11. {
  12. if(!strcmp(cmdtext, "/saugoti", true))
  13. {
  14. if(!cmdtext[7]))
  15. {
  16. return SendClientMessage(playerid, -1, "/saugoti <tekstas>");
  17. }
  18. SendClientMessage(playerid, -1, "Koordinates sekmingai iðsaugotos: scriptfiles/Pozicijos.txt");
  19. new
  20. saveStr[128],
  21. Float:X,
  22. Float:Y,
  23. Float:Z,
  24. Float:A;
  25. GetPlayerPos(playerid, X, Y, Z);
  26. GetPlayerFacingAngle(playerid, A);
  27. format(saveStr, 128, "%.3f, %.3f, %.3f, %.3f // %s", X, Y, Z, A, cmdtext[7]);
  28. new File:Koordinates = fopen("Pozicijos.txt", io_write);
  29. public OnGameModeInit()
  30. {
  31. if(!fexist("Pozicijos.txt"))
  32. {
  33. new File:Koordinates = fopen("Pozicijos.txt", io_write);
  34. fclose(Koordinates);
  35. }
  36. }
  37.  
  38. public OnPlayerCommandText(playerid, cmdtext[])
  39. {
  40. if(!strcmp(cmdtext, "/saugoti", true))
  41. {
  42. if(!cmdtext[7]))
  43. {
  44. return SendClientMessage(playerid, -1, "/saugoti <tekstas>");
  45. }
  46. SendClientMessage(playerid, -1, "Koordinates sekmingai iðsaugotos: scriptfiles/Pozicijos.txt");
  47. new
  48. saveStr[128],
  49. Float:X,
  50. Float:Y,
  51. Float:Z,
  52. Float:A;
  53. GetPlayerPos(playerid, X, Y, Z);
  54. GetPlayerFacingAngle(playerid, A);
  55. format(saveStr, 128, "%.3f, %.3f, %.3f, %.3f // %s", X, Y, Z, A, cmdtext[7]);
  56. new File:Koordinates = fopen("Pozicijos.txt", io_write);
  57. public OnGameModeInit()
  58. {
  59. if(!fexist("Pozicijos.txt"))
  60. {
  61. new File:Koordinates = fopen("Pozicijos.txt", io_write);
  62. fclose(Koordinates);
  63. }
  64. }
  65.  
  66. public OnPlayerCommandText(playerid, cmdtext[])
  67. {
  68. if(!strcmp(cmdtext, "/saugoti", true))
  69. {
  70. if(!cmdtext[7]))
  71. {
  72. return SendClientMessage(playerid, -1, "/saugoti <tekstas>");
  73. }
  74. SendClientMessage(playerid, -1, "Koordinates sekmingai iðsaugotos: scriptfiles/Pozicijos.txt");
  75. new
  76. saveStr[128],
  77. Float:X,
  78. Float:Y,
  79. Float:Z,
  80. Float:A;
  81. GetPlayerPos(playerid, X, Y, Z);
  82. GetPlayerFacingAngle(playerid, A);
  83. format(saveStr, 128, "%.3f, %.3f, %.3f, %.3f // %s", X, Y, Z, A, cmdtext[7]);
  84. new File:Koordinates = fopen("Pozicijos.txt", io_write);
  85. fwrite(Koordinates, saveStr);
  86. fwrite(Koordinates, "\r\n");
  87. fclose(Koordinates);
  88. return 1;
  89. }
  90. return 0;
  91. }
  92. fwrite(Koordinates, "\r\n");
  93. fclose(Koordinates);
  94. return 1;
  95. }
  96. return 0;
  97. }
  98. fwrite(Koordinates, "\r\n");
  99. fclose(Koordinates);
  100. return 1;
  101. }
  102. return 0;
  103. }
Advertisement
Add Comment
Please, Sign In to add comment