Advertisement
toribio

toribio

May 8th, 2009
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.47 KB | None | 0 0
  1. /*
  2.     ----------------------------------------------------------------------------
  3.     Arquivo: location.pwn
  4.     Versão: 0.5
  5.     Autor: Roger Gomes Costa 'Niko'
  6.     Contato: roger_pca22@hotmail.com
  7.    
  8.     Stocks utilizadas: IsPlayerInArea (Y_Less)
  9.     ----------------------------------------------------------------------------
  10.     Atenção: se for adicionar, favor escrever corretamente. Obrigado.
  11. */
  12.  
  13. #include <a_samp>
  14.  
  15. #file "Location Filterscript 0.5"
  16.  
  17. #define Branco
  18. #define Vermelho
  19. #define Azul
  20. #define Amarelo
  21. #define Verde
  22. #define Roxo
  23. #define Marrom
  24.  
  25. enum Zone_Info
  26. {
  27.     locationname[128],
  28.     Float:xmin,
  29.     Float:ymin,
  30.     Float:xmax,
  31.     Float:ymax
  32. };
  33.  
  34. new Locations[][Zone_Info] =
  35. {
  36.     {"LS - Grove Street", 2356.912, -1741.078, 2524.237, -1634.489},
  37.     {"LS - Aeroporto", 1364.372, -2700.379, 2147.756, -2199.016},
  38.     {"LS - Praia", 200.7038, -1914.779, 748.3121, -1768.712}
  39. };
  40.  
  41. public OnPlayerCommandText(playerid, cmdtext[])
  42. {
  43.     if(strcmp(cmdtext, "/porra", true) == 0)
  44.     {
  45.         new s[128];
  46.         format(s, sizeof(s), "Sua localização: %s", GetPlayerArea(playerid));
  47.         SendClientMessage(playerid, Roxo, s);
  48.         return true;
  49.     }
  50.     return false;
  51. }
  52.  
  53.  
  54.  
  55. stock GetPlayerArea(playerid)
  56. {
  57.     new s[128] = "", Float:x, Float:y, Float:z;
  58.     for(new i = 0; i < sizeof(Locations); i++)
  59.     {
  60.         if(x >= Locations[i][xmin]&& y >= Locations[i][ymin] && x <= Locations[i][xmax] && y <= Locations[i][ymax])
  61.         {
  62.             format(s, sizeof(s), "%s", Locations[i][locationname]);
  63.             break;
  64.         }
  65.     }
  66.     return s;
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement