DiGiTaL_AnGeL

DPS

Mar 15th, 2013
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.35 KB | None | 0 0
  1. /*
  2. ________________________
  3. ___  __ \__  __ \_  ___/
  4. __  / / /_  /_/ /____ \
  5. _  /_/ /_  ____/____/ /
  6. /_____/ /_/     /____/
  7.  
  8. Made by DiGiTaL AnGeL
  9. */
  10. #define FILTERSCRIPT
  11. //______________________________INCLUDES________________________________________
  12. #include <a_samp>
  13. #include <YSI\y_commands>
  14. //_______________________________DEFINES________________________________________
  15. #define SCM SendClientMessage
  16.  
  17. public OnFilterScriptInit()
  18. {
  19.     print("=-=-=-=-=-=LOADED=-=-=-=-=-=");
  20.     print("=  DiGitaL position saver  =");
  21.     print("=        by DiGiTaL_AnGeL  =");
  22.     print("=-=-=-=-=-=LOADED=-=-=-=-=-=");
  23.     return 1;
  24. }
  25.  
  26. public OnFilterScriptExit()
  27. {
  28.     print("=-=-=-=-=-UNLOADED-=-=-=-=-=");
  29.     print("=  DiGitaL position saver  =");
  30.     print("=        by DiGiTaL_AnGeL  =");
  31.     print("=-=-=-=-=-UNLOADED-=-=-=-=-=");
  32.     return 1;
  33. }
  34.  
  35. //______________________________COMMANDS________________________________________
  36. YCMD:savepos(playerid, params[], help)
  37. {
  38.     if(help)
  39.     {
  40.         SCM(playerid, 0x30303090, "This cmd allows you to easily save your position for 3 different functions.");
  41.     }
  42.     else
  43.     {
  44.         if(!IsPlayerAdmin(playerid))
  45.         {
  46.             SCM(playerid, 0xFF0000FF, "You are not authorized to do that!");
  47.         }
  48.         else
  49.         {
  50.             if(isnull(params))
  51.             {
  52.                 SCM(playerid, 0x394562FF, "USAGE** {FFFFFF}/savepos [type] [comment]");
  53.                 SCM(playerid, 0x394562FF, "TYPES : 1. SetPlayerPos | 2. IsPlayerInRangeOfPoint | 3. PlayerToPoint ");
  54.             }
  55.             else
  56.             {
  57.                 new fstring[128];
  58.                 new Float:x, Float:y, Float:z;
  59.                 GetPlayerPos(playerid, x, y, z);
  60.                 new File:dpos = fopen("digital_positions.txt", io_append);
  61.                 if(dpos)
  62.                 {
  63.                     if(!strcmp(params, "1", true))
  64.                     {
  65.                         format(fstring, sizeof(fstring), "\n    SetPlayerPos(playerid, %f, %f, %f);//%s\r", x, y, z, params[2]);
  66.                         fwrite(dpos, fstring);
  67.                     }
  68.                     else if(!strcmp(params, "2", true))
  69.                     {
  70.                         format(fstring, sizeof(fstring), "\n    IsPlayerInRangeOfPoint(playerid, 5.0, %f, %f, %f) //%s\r", x, y, z, params[2]);
  71.                         fwrite(dpos, fstring);
  72.                     }
  73.                     else if(!strcmp(params, "3", true))
  74.                     {
  75.                         format(fstring, sizeof(fstring), "\n    PlayerToPoint(5.0, playerid, %f, %f, %f) //%s\r", x, y, z, params[2]);
  76.                         fwrite(dpos, fstring);
  77.                     }
  78.                     fclose(dpos);
  79.                     return 1;
  80.                 }
  81.             }
  82.         }
  83.     }
  84.     return 1;
  85. }
Advertisement
Add Comment
Please, Sign In to add comment