Advertisement
Guest User

New Area 51 - by Mattos

a guest
Jan 13th, 2012
1,112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 7.23 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  4. new gate1status = 1;
  5. new gate1;
  6. new gate2status = 1;
  7. new gate2;
  8.  
  9. public OnPlayerConnect(playerid)
  10. {  
  11.     // Area 51
  12.     RemoveBuildingForPlayer(playerid, 16094, 135, 1940, 21, 500.0);
  13.     RemoveBuildingForPlayer(playerid, 16668, 135, 1940, 21, 500.0);
  14.     RemoveBuildingForPlayer(playerid, 16669, 135, 1940, 21, 500.0);
  15.     RemoveBuildingForPlayer(playerid, 16670, 135, 1940, 21, 500.0);
  16.     RemoveBuildingForPlayer(playerid, 16671, 135, 1940, 21, 500.0);
  17.     RemoveBuildingForPlayer(playerid, 1411, 135, 1940, 21, 500.0);
  18.     RemoveBuildingForPlayer(playerid, 16095, 135, 1940, 21, 500.0);
  19.     RemoveBuildingForPlayer(playerid, 16096, 135, 1940, 21, 500.0);
  20.     return 1;
  21. }
  22.  
  23. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  24. {
  25.     if(IsPlayerConnected(playerid))
  26.     {
  27.         new Float:oldposx, Float:oldposy, Float:oldposz;
  28.         new Float:tempposx, Float:tempposy, Float:tempposz;
  29.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  30.         tempposx = (oldposx -x);
  31.         tempposy = (oldposy -y);
  32.         tempposz = (oldposz -z);
  33.         if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  34.         {
  35.             return 1;
  36.         }
  37.     }
  38.     return 0;
  39. }
  40.  
  41. public OnFilterScriptInit()
  42. {
  43.     CreateObject(10815, 133.6533203125, 2043.1025390625, 18.57629776001, 358.00048828125, 357.98950195313, 225.90637207031);
  44.     CreateObject(10816, -14.828125, 1868.88671875, 26.521730422974, 0, 0, 91.499633789063);
  45.     CreateObject(10766, -24.480167388916, 1508.2329101563, 25.627000808716, 0, 0, 181.69189453125);
  46.     CreateObject(10767, -27.9248046875, 1631.3310546875, 12.958110809326, 0, 0, 46.494140625);
  47.     CreateObject(8240, 87.517578125, 1980.998046875, 40.895473480225, 0, 0, 91.983032226563);
  48.     CreateObject(3816, 88.90877532959, 1706.7727050781, 36.099998474121, 0, 0, 271.99951171875);
  49.     CreateObject(8417, 101.568359375, 1962.4521484375, 27.569999694824, 0, 179.99450683594, 0);
  50.     CreateObject(8417, 100.21939086914, 2002.0568847656, 27.569999694824, 0, 179.99450683594, 0);
  51.     CreateObject(8417, 60.9609375, 1999.1875, 27.549999237061, 0, 179.99450683594, 0);
  52.     CreateObject(8417, 60.297721862793, 1959.5102539063, 27.549999237061, 0, 179.99450683594, 0);
  53.     CreateObject(10766, -35.643119812012, 1948.1413574219, 6.1270008087158, 10, 0, 1.6973876953125);
  54.     CreateObject(10767, 32.702865600586, 1853.2064208984, 6.25, 9.84375, 10.140380859375, 225.49436950684);
  55.     CreateObject(16093, 0.59614109992981, 1951.9377441406, 32.286949157715, 0, 0, 268.99475097656);
  56.     CreateObject(16638, -0.35728269815445, 1951.8317871094, 30.458232879639, 0, 0, 268.99475097656);
  57.     CreateObject(3819, 0.71044266223907, 1832.5158691406, 29.00386428833, 0, 0, 0);
  58.     CreateObject(3819, 0.69866698980331, 1823.5090332031, 29.00386428833, 0, 0, 0);
  59.     CreateObject(3819, 0.67185890674591, 1814.5069580078, 29.00386428833, 0, 0, 0);
  60.     CreateObject(10764, -22.357421875, 1429.734375, 31.047883987427, 0, 0, 225.99975585938);
  61.     CreateObject(4106, 85.213928222656, 1939.0867919922, 26.129997253418, 0, 0, 91.99951171875);
  62.     CreateObject(971, 322.72790527344, 1781.2412109375, 20.169790267944, 0, 0, 131.99353027344);
  63.     CreateObject(8240, 87.517578125, 1980.998046875, 13.665477752686, 0, 179.99450683594, 91.983032226563);
  64.     CreateObject(9241, 171.94921875, 2003.0087890625, 18.199523925781, 0, 0, 179.99450683594);
  65.     CreateObject(16293, 186.8818359375, 2081.974609375, 21.167821884155, 0, 0, 181.99951171875);
  66.     CreateObject(16293, 355.080078125, 2028.833984375, 20.917821884155, 0, 0, 181.98303222656);
  67.     CreateObject(4106, 116.02003479004, 1914.994140625, 8.75, 35.9912109375, 0, 1.99951171875);
  68.     CreateObject(8314, 134.1201171875, 1948.619140625, 19.950902938843, 0, 0, 105.99063110352);
  69.     CreateObject(8210, 170.04811096191, 2095.0473632813, 19.364845275879, 0, 0, 27.975830078125);
  70.     CreateObject(4874, 80.176872253418, 1854.5533447266, 20.122299194336, 0, 0, 90);
  71.     CreateObject(9241, 172.0724029541, 1966.1715087891, 18.199523925781, 0, 0, 179.99450683594);
  72.     CreateObject(16133, 18.10350227356, 1678.6729736328, 14.920623779297, 358.00048828125, 3.9935302734375, 254.09484863281);
  73.     CreateObject(3816, 86.5908203125, 1769.2016601563, 36.099998474121, 0, 0, 271.99951171875);
  74.     CreateObject(8314, 330.59747314453, 1788.943359375, 19.450902938843, 0, 0, 147.99017333984);
  75.     CreateObject(3881, 326.22305297852, 1783.1794433594, 18.4921875, 0, 0, 221.98901367188);
  76.     CreateObject(16133, 66.3759765625, 1668.02734375, 15.170623779297, 358.00048828125, 3.988037109375, 66.09375);
  77.     CreateObject(3816, 88.908203125, 1706.7724609375, 19.139999389648, 0, 180, 271.99954223633);
  78.     CreateObject(3816, 86.618705749512, 1769.2032470703, 19.099998474121, 0, 179.99450683594, 271.99951171875);
  79.     CreateObject(3268, 163.328125, 1802.3466796875, 16.210586547852, 0, 0, 270);
  80.     CreateObject(8154, 292.33255004883, 2080.8762207031, 19.491653442383, 0, 0, 90);
  81.     CreateObject(8150, 128.85551452637, 1786.2309570313, 19.511135101318, 0, 0, 0);
  82.     CreateObject(3881, 121.73063659668, 1934.3829345703, 19.9921875, 0, 0, 179.98901367188);
  83.     CreateObject(8150, 254.73617553711, 1786.2735595703, 19.511135101318, 0, 0, 0);
  84.     CreateObject(8150, 145.41893005371, 2018.8333740234, 19.511135101318, 0, 0, 270);
  85.     CreateObject(8150, 334.39544677734, 1990.6801757813, 19.511135101318, 0, 0, 89.999938964844);
  86.     CreateObject(8210, 222.50563049316, 2107.9545898438, 19.364845275879, 0, 0, 359.97119140625);
  87.     CreateObject(8150, 334.38580322266, 1864.8421630859, 19.511135101318, 0, 0, 89.994506835938);
  88.     CreateObject(10764, 307.53002929688, 1742.833984375, 18.797883987427, 0, 0, 224.5);    
  89.  
  90.     // Gates
  91.     gate1 = CreateObject(980, 135.49632263184, 1941.0627441406, 21.078227996826, 0, 0, 0); // CreateObject(980, 146.02250671387, 1940.9958496094, 21.078227996826, 0, 0, 0);
  92.     gate2 = CreateObject(980, 336.25271606445, 1783.76171875, 19.578227996826, 0, 0, 221.99951171875); // CreateObject(980, 328.88110351563, 1776.9982910156, 19.578227996826, 0, 0, 221.99523925781);
  93.     return 1;
  94. }
  95.  
  96. public OnFilterScriptExit()
  97. {
  98.     DestroyObject(gate1);
  99.     DestroyObject(gate2);
  100.     return 1;
  101. }
  102.  
  103. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  104. {
  105.     if (newkeys == 16 || newkeys == 2)
  106.     {
  107.         new sendername[MAX_PLAYER_NAME];
  108.         GetPlayerName(playerid,sendername,sizeof(sendername));
  109.         if(PlayerToPoint(11, playerid, 135.49632263184, 1941.0627441406, 21.078227996826))
  110.         {
  111.             if(gate1status == 1)
  112.             {
  113.                 MoveObject(gate1, 146.02250671387, 1940.9958496094, 21.078227996826, 6);
  114.                 gate1status = 0;
  115.             }
  116.             else if(gate1status == 0)
  117.             {
  118.                 MoveObject(gate1, 135.49632263184, 1941.0627441406, 21.078227996826, 6);
  119.                 gate1status = 1;
  120.             }
  121.         }
  122.         if(PlayerToPoint(11, playerid, 336.25271606445, 1783.76171875, 19.578227996826))
  123.         {
  124.             if(gate2status == 1)
  125.             {
  126.                 MoveObject(gate2, 328.88110351563, 1776.9982910156, 19.578227996826, 6);
  127.                 gate2status = 0;
  128.             }
  129.             else if(gate2status == 0)
  130.             {
  131.                 MoveObject(gate2, 336.25271606445, 1783.76171875, 19.578227996826, 6);
  132.                 gate2status = 1;
  133.             }
  134.         }
  135.         return 1;
  136.     }
  137.     return 0;
  138. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement