Advertisement
Guest User

[Include] GetPlayerPosPlace

a guest
May 8th, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.17 KB | None | 0 0
  1. /*
  2. Įskiepis (Include) GetPlayerPosPlace v0.02 R1(Release) (2014). Su šia funcija galėsite lengvai išgaut žaidėjo miestą.
  3.  - Draudžiama: Platint šį include be autoriaus leidimo.
  4.  - Draudžiama: Šalinimas arba keitimas šio komentaro.
  5.     Autorius: Alex_Lenez | Sulietuvino Evaldas .
  6.     Naudojimas: Include naudoj pluginą Streamer 2.6.1
  7. */
  8. //#define IsPlace(%0, %1) IsPlayerInDynamicArea(%0, %1)
  9. #define PLAYER_INVALID_PLACE (-1)
  10. #define PLAYER_IN_SAN_FIERRO (0)
  11. #define PLAYER_IN_LOS_SANTOS (1)
  12. #define PLAYER_IN_LAS_VENTURAS (2)
  13. #define MAX_ZONES (3)
  14.  
  15. new zones[MAX_ZONES];
  16. new Float:ZONE_SF[] = {
  17.         -2988.0,-2980.0,
  18.         -2985.0,2990.0,
  19.         -1970.0,2980.0,
  20.         -2114.0,2285.0,
  21.         -1960.0,2134.0,
  22.         -1871.0,2002.0,
  23.         -1755.0,1748.0,
  24.         -1626.0,1679.0,
  25.         -1314.0,1563.0,
  26.         -1219.0,1434.0,
  27.         -1191.0,1272.0,
  28.         -1208.0,1136.0,
  29.         -1111.0,1069.0,
  30.         -995.0,914.0,
  31.         -945.0,758.0,
  32.         -803.0,582.0,
  33.         -729.0,522.0,
  34.         -657.0,495.0,
  35.         -647.0,418.0,
  36.         -867.0,210.0,
  37.         -973.0,-1.0,
  38.         -1033.0,-244.0,
  39.         -1067.0,-386.0,
  40.         -1185.0,-561.0,
  41.         -1212.0,-656.0,
  42.         -1227.0,-1434.0,
  43.         -1211.0,-1718.0,
  44.         -1198.0,-2003.0,
  45.         -1157.0,-2199.0,
  46.         -1233.0,-2468.0,
  47.         -1191.0,-2609.0,
  48.         -1149.0,-2710.0,
  49.         -1113.0,-2957.0,
  50.         -1101.0,-2991.0,
  51.         -2988.0,-2980.0
  52. };
  53. new Float:ZONE_LS[] = {
  54.         -1101.0,-2990.0,
  55.         2989.0,-2989.0,
  56.         2940.0,449.0,
  57.         1890.0,507.0,
  58.         1349.0,580.0,
  59.         1057.0,634.0,
  60.         833.0,576.0,
  61.         455.0,435.0,
  62.         12.0,388.0,
  63.         -343.0,386.0,
  64.         -561.0,407.0,
  65.         -644.0,417.0,
  66.         -869.0,210.0,
  67.         -974.0,-2.0,
  68.         -1032.0,-244.0,
  69.         -1069.0,-386.0,
  70.         -1187.0,-564.0,
  71.         -1214.0,-656.0,
  72.         -1198.0,-2004.0,
  73.         -1158.0,-2199.0,
  74.         -1233.0,-2468.0,
  75.         -1151.0,-2712.0,
  76.         -1101.0,-2990.0
  77. };
  78. new Float:ZONE_LV[] = {
  79.         -1971.0,2979.0,
  80.         -759.0,2996.0,
  81.         2991.0,2993.0,
  82.         2985.0,709.0,
  83.         2940.0,448.0,
  84.         1889.0,505.0,
  85.         1350.0,579.0,
  86.         1056.0,633.0,
  87.         833.0,578.0,
  88.         454.0,435.0,
  89.         12.0,388.0,
  90.         -344.0,386.0,
  91.         -561.0,408.0,
  92.         -647.0,419.0,
  93.         -658.0,492.0,
  94.         -730.0,520.0,
  95.         -805.0,582.0,
  96.         -944.0,757.0,
  97.         -994.0,914.0,
  98.         -1110.0,1067.0,
  99.         -1209.0,1138.0,
  100.         -1192.0,1273.0,
  101.         -1220.0,1432.0,
  102.         -1314.0,1561.0,
  103.         -1626.0,1679.0,
  104.         -1755.0,1747.0,
  105.         -1873.0,2002.0,
  106.         -1961.0,2135.0,
  107.         -2114.0,2284.0,
  108.         -1971.0,2979.0
  109. };
  110. stock GetPlayerPosPlace(playerid)
  111. {
  112.     new ReturnPlayer = -1;
  113.     for(new i = 0; i < MAX_ZONES; i++) 
  114.     {
  115.         if(!IsPlayerInDynamicArea(playerid, zones[i])) continue;
  116.         ReturnPlayer = i;
  117.        
  118.     }
  119.     return ReturnPlayer;
  120. }
  121. // function features version 0.3
  122. /*GetPlayerPlaceCode(code[], source[])
  123. {
  124.     new fArray = {"distance"};
  125.     if(strcmp(code, fArray[0], true) == 0){
  126.         new res = strval(source);
  127.        
  128.     }
  129. }*/
  130. stock place_init()
  131. {
  132.     zones[0] = CreateDynamicPolygon(ZONE_SF);
  133.     zones[1] = CreateDynamicPolygon(ZONE_LS);
  134.     zones[2] = CreateDynamicPolygon(ZONE_LV);  
  135.     return 1;
  136. }
  137.  
  138. /*
  139. GetPlayerPosPlace(playerid)
  140. PLAYER_INVALID_PLACE:   Jeigu žaidėjas randas už San-Andreas mapo (Už SF, LV, LS miestų) (okeane, toli nuo miesto).
  141. PLAYER_IN_SAN_FIERRO:   Jeigu žaidėjas randas San Fierro mieste
  142. PLAYER_IN_LOS_SANTOS:   Jeigu žaidėjas randas Los Santos mieste
  143. PLAYER_IN_LAS_VENTURAS: Jeigu žaidėjas randas Las Venturas mieste
  144. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement