Advertisement
Lordz

L_Area51

Jan 8th, 2014
709
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.02 KB | None | 0 0
  1. /*______________________________________________________________________________
  2.  
  3.                         Lordz's Restricted Area 51
  4.                         Copyright(c) - 2014 "L_Area51"
  5.  
  6. This filterscript is an example of L_SAM3 (L_SAM version 1.3). Many of you might
  7. have seen S-A-M missiles on Restricted Area of Area 51 on GTA San Andreas.
  8. However, those don't work really on SA-MP. Using this filterscript, it'll work!
  9.  
  10. NOTES:
  11. If you got any teams spawning on that location and if you don't want them to get
  12. attacked by S-A-M, use "Area51_NoAttacks" function. Else if they want to get
  13. attacked, use "Area51_AttackPlayer" function on them.
  14.  
  15. The missiles are kept to follow and while following if player goes out of range,
  16. it will stop following and gets exploded as "followlimit" is kept to true.
  17.  
  18. Once if you're logged in as RCON, the S-A-M missiles won't attack you.
  19.  
  20. Example:
  21.  
  22. public OnPlayerSpawn(playerid)
  23. {
  24.  if(GetPlayerTeam(playerid) == TEAM_ARMY) Area51_NoAttacks(playerid);
  25.  else Area51_AttackPlayer(playerid);
  26.  return 1;
  27. }
  28.  
  29.  
  30. PS : My indentation isn't so clean, so here by, I'm trying to do better
  31.      indentations...
  32. ________________________________________________________________________________*/
  33.  
  34. #define FILTERSCRIPT
  35.  
  36. #include <a_samp>
  37. #include <L_SAM3>
  38.  
  39. #define AREA51_RANGE 170.0 //The range of detection on the SAM missiles kept in area.
  40.  
  41. new L_Area51[4];
  42.  
  43.  
  44. stock Area51_NoAttacks(playerid)
  45. {
  46.     for(new i; i< 4; i++)
  47.     {
  48.         AvoidSAMAttacksOnPlayer(playerid, L_Area51[i]);
  49.     }
  50.     return 1;
  51. }
  52.  
  53. stock Area51_AttackPlayer(playerid)
  54. {
  55.     for(new i; i< 4; i++)
  56.     {
  57.         EnableSAMAttacksOnPlayer(playerid, L_Area51[i]);
  58.     }
  59.     return 1;
  60. }
  61.  
  62.  
  63.  
  64. public OnPlayerConnect(playerid)
  65. {
  66.     //Removes the original S-A-M objects placed on Area 51 which don't work.
  67.     RemoveBuildingForPlayer(playerid, 3267, 188.2422, 2081.6484, 22.4453, 0.25);
  68.     RemoveBuildingForPlayer(playerid, 3267, 15.6172, 1719.1641, 22.4141, 0.25);
  69.     RemoveBuildingForPlayer(playerid, 3267, 237.6953, 1696.8750, 22.4141, 0.25);
  70.     RemoveBuildingForPlayer(playerid, 3267, 354.4297, 2028.4922, 22.4141, 0.25);
  71.     Area51_AttackPlayer(playerid);
  72.     return 1;
  73. }
  74.  
  75. public OnFilterScriptInit()
  76. {
  77.     for(new playerid; playerid< GetMaxPlayers(); playerid++)
  78.     {
  79.         if(!IsPlayerConnected(playerid)) continue;
  80.         RemoveBuildingForPlayer(playerid, 3267, 188.2422, 2081.6484, 22.4453, 0.25);
  81.         RemoveBuildingForPlayer(playerid, 3267, 15.6172, 1719.1641, 22.4141, 0.25);
  82.         RemoveBuildingForPlayer(playerid, 3267, 237.6953, 1696.8750, 22.4141, 0.25);
  83.         RemoveBuildingForPlayer(playerid, 3267, 354.4297, 2028.4922, 22.4141, 0.25);
  84.         Area51_AttackPlayer(playerid);
  85.     }
  86.     L_Area51[0] = CreateSAM(188.24, 2081.65, 22.51,   0.00, 0.00, -0.66, 300.0, AREA51_RANGE, 80, 2, true,true);
  87.     L_Area51[1] = CreateSAM(354.13, 2028.33, 21.98,   0.00, 0.00, 0.00, 300.0, AREA51_RANGE, 80, 2, true,true);
  88.     L_Area51[2] = CreateSAM(238.68, 1696.95, 22.35,   0.00, 0.00, 0.00, 300.0, AREA51_RANGE, 80, 2, true,true);
  89.     L_Area51[3] = CreateSAM(16.20, 1719.31, 22.42,   0.00, 0.00, 0.00, 300.0, AREA51_RANGE, 80, 2, true,true);
  90.     printf("------------------------------------");
  91.     printf("Restricted Area 51 by Lordz Loaded!");
  92.     printf("------------------------------------");
  93.     return 1;
  94. }
  95.  
  96. public OnFilterScriptExit()
  97. {
  98.     printf("------------------------------------");
  99.     printf("Restricted Area 51 by Lordz unloaded!");
  100.     printf("------------------------------------");
  101.     return 1;
  102. }
  103.  
  104. public OnSAMMissileHitPlayer(playerid, samid)
  105. {
  106.     for(new i; i< 4; i++)
  107.     {
  108.         if(samid == L_Area51[i]) GameTextForPlayer(playerid, "~Y~STAY AWAY FROM THE ~R~BOUNDARIES OF AREA51!", 1800, 3);
  109.     }
  110.     return 1;
  111. }
  112.  
  113. public OnSAMMissileLaunch(playerid, samid)
  114. {
  115.     for(new i; i< 4; i++)
  116.     {
  117.         if(samid == L_Area51[i]) GameTextForPlayer(playerid, "~R~WARNING:~N~~G~STAY AWAY FROM AREA51!", 1200, 3);
  118.     }
  119.     return 1;
  120. }
  121.  
  122. public OnPlayerUpdate(playerid)
  123. {
  124.     if(IsPlayerAdmin(playerid))
  125.     {
  126.         for(new i; i< 4; i++)
  127.         {
  128.             AvoidSAMAttacksOnPlayer(playerid, L_Area51[i]);
  129.         }
  130.     }
  131.     return 1;
  132. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement