Advertisement
Guest User

[FS] - Salvar Cordenadas

a guest
Sep 22nd, 2010
470
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.34 KB | None | 0 0
  1. /*
  2.  *  Save Pos By KevinsL
  3.  *
  4.  *  Acesse: www.HomeHots.net / www.BrasilRealLife.com
  5.  *  Favor não retirar os creditos!
  6.  *  Creditos a KevinsL & Wiki
  7. */
  8.  
  9. #include <a_samp>
  10. #define FILTERSCRIPT
  11.  
  12. strtok(const string[], &index)
  13. {
  14.     new length = strlen(string);
  15.     while ((index < length) && (string[index] <= ' '))
  16.     {
  17.         index++;
  18.     }
  19.  
  20.     new offset = index;
  21.     new result[20];
  22.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  23.     {
  24.         result[index - offset] = string[index];
  25.         index++;
  26.     }
  27.     result[index - offset] = EOS;
  28.     return result;
  29. }
  30.  
  31. public OnFilterScriptInit()
  32. {
  33.     print("\n----------------------------");
  34.     print(" Save Pos by KevinsL Loaded");
  35.     print("----------------------------\n");
  36.     return 1;
  37. }
  38.  
  39. public OnFilterScriptExit()
  40. {
  41.     return 1;
  42. }
  43.  
  44. public OnPlayerRequestClass(playerid, classid)
  45. {
  46.     return 1;
  47. }
  48.  
  49. public OnPlayerConnect(playerid)
  50. {
  51.     SendClientMessage(playerid, 0xFF0000AA, "Save Pos by KevinsL Loaded!");
  52.     return 1;
  53. }
  54.  
  55. public OnPlayerDisconnect(playerid, reason)
  56. {
  57.     return 1;
  58. }
  59.  
  60. public OnPlayerSpawn(playerid)
  61. {
  62.     return 1;
  63. }
  64.  
  65. public OnPlayerDeath(playerid, killerid, reason)
  66. {
  67.     return 1;
  68. }
  69.  
  70. public OnVehicleSpawn(vehicleid)
  71. {
  72.     return 1;
  73. }
  74.  
  75. public OnVehicleDeath(vehicleid, killerid)
  76. {
  77.     return 1;
  78. }
  79.  
  80. public OnPlayerText(playerid, text[])
  81. {
  82.     return 1;
  83. }
  84.  
  85. public OnPlayerCommandText(playerid, cmdtext[])
  86. {
  87.     new cmd[128], idx;
  88.     cmd = strtok(cmdtext, idx);
  89.  
  90.     if(strcmp(cmd, "/salvarpos", true)==0 || strcmp(cmd, "/sp", true)==0 || strcmp(cmd, "/salvar", true)==0)
  91.     {
  92.         new tmp[128];
  93.         tmp = strtok(cmdtext, idx);
  94.  
  95.         new stringpos[256], stringsalvo[256], stringcoment[256];
  96.         new Float:X, Float:Y, Float:Z, Float:Rotation;
  97.         GetPlayerPos(playerid, X, Y, Z);
  98.         GetPlayerFacingAngle(playerid, Rotation);
  99.         new File:pos=fopen("posicao.txt", io_append);
  100.         format(stringcoment, 256, "\n%s: ", tmp);
  101.         format(stringpos, 256, "X: %f, Y: %f, Z: %f, Rotacao: %f", X, Y, Z,Rotation);
  102.         format(stringsalvo, 256, "Posição salva: %s: X: %f, Y: %f, Z: %f, Rotacao: %f", tmp, X, Y, Z,Rotation);
  103.         fwrite(pos, stringcoment);
  104.         fwrite(pos, stringpos);
  105.         print(stringsalvo);
  106.         SendClientMessage(playerid, 0xFF0000AA, stringsalvo);
  107.         fclose(pos);
  108.         return 1;
  109.     }
  110.  
  111.     if(strcmp(cmdtext, "/ajudapos", true)==0)
  112.     {
  113.         SendClientMessage(playerid, 0xFFFFFFAA, "Use: /salvarpos [comentario] e salve a posição desejada! o arquivo será salvo na pasta: scriptfiles");
  114.         return 1;
  115.     }
  116.  
  117.     return 0;
  118. }
  119.  
  120. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  121. {
  122.     return 1;
  123. }
  124.  
  125. public OnPlayerExitVehicle(playerid, vehicleid)
  126. {
  127.     return 1;
  128. }
  129.  
  130. public OnPlayerStateChange(playerid, newstate, oldstate)
  131. {
  132.     return 1;
  133. }
  134.  
  135. public OnPlayerEnterCheckpoint(playerid)
  136. {
  137.     return 1;
  138. }
  139.  
  140. public OnPlayerLeaveCheckpoint(playerid)
  141. {
  142.     return 1;
  143. }
  144.  
  145. public OnPlayerEnterRaceCheckpoint(playerid)
  146. {
  147.     return 1;
  148. }
  149.  
  150. public OnPlayerLeaveRaceCheckpoint(playerid)
  151. {
  152.     return 1;
  153. }
  154.  
  155. public OnRconCommand(cmd[])
  156. {
  157.     return 1;
  158. }
  159.  
  160. public OnPlayerRequestSpawn(playerid)
  161. {
  162.     return 1;
  163. }
  164.  
  165. public OnObjectMoved(objectid)
  166. {
  167.     return 1;
  168. }
  169.  
  170. public OnPlayerObjectMoved(playerid, objectid)
  171. {
  172.     return 1;
  173. }
  174.  
  175. public OnPlayerPickUpPickup(playerid, pickupid)
  176. {
  177.     return 1;
  178. }
  179.  
  180. public OnVehicleMod(playerid, vehicleid, componentid)
  181. {
  182.     return 1;
  183. }
  184.  
  185. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  186. {
  187.     return 1;
  188. }
  189.  
  190. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  191. {
  192.     return 1;
  193. }
  194.  
  195. public OnPlayerSelectedMenuRow(playerid, row)
  196. {
  197.     return 1;
  198. }
  199.  
  200. public OnPlayerExitedMenu(playerid)
  201. {
  202.     return 1;
  203. }
  204.  
  205. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  206. {
  207.     return 1;
  208. }
  209.  
  210. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  211. {
  212.     return 1;
  213. }
  214.  
  215. public OnRconLoginAttempt(ip[], password[], success)
  216. {
  217.     return 1;
  218. }
  219.  
  220. public OnPlayerUpdate(playerid)
  221. {
  222.     return 1;
  223. }
  224.  
  225. public OnPlayerStreamIn(playerid, forplayerid)
  226. {
  227.     return 1;
  228. }
  229.  
  230. public OnPlayerStreamOut(playerid, forplayerid)
  231. {
  232.     return 1;
  233. }
  234.  
  235. public OnVehicleStreamIn(vehicleid, forplayerid)
  236. {
  237.     return 1;
  238. }
  239.  
  240. public OnVehicleStreamOut(vehicleid, forplayerid)
  241. {
  242.     return 1;
  243. }
  244.  
  245. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  246. {
  247.     return 1;
  248. }
  249.  
  250. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  251. {
  252.     return 1;
  253. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement