Advertisement
Guest User

Untitled

a guest
Mar 20th, 2011
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.88 KB | None | 0 0
  1. //this script is by [UG]Mobster property of ultimate-gamers and sa-mp forums please do not remove any credits. thank-you
  2.  
  3. #include <a_samp>
  4.  
  5. //ug carrier
  6. new lift11;//elevator varible
  7. new lift22;//sidelift varible
  8. new lift1;//elevator object
  9. new lift2;//sidelift object
  10.  
  11. #define CarrierCatapultX 2308.7783
  12. #define CarrierCatapultY -3355.8147
  13. #define CarrierCatapultZ 18.5131
  14.  
  15. #define CatapultSpeed 45
  16. #define EjectHeight 20
  17.  
  18. public OnFilterScriptInit()
  19. {
  20.     print("\n--------------------------------------");
  21.     print(" Aircraft Carrier + Catapult By [UG]Mobster");
  22.     print(" Ultiamte-Gamers www.ultimategamers.info");
  23.     print("--------------------------------------\n");
  24.    
  25.     //lift objects
  26.     lift1 = CreateObject(3115, 2438.869141, -3349.019531, 17.201916, 0.0000, 0.0000, 0.0001);
  27.     lift2 = CreateObject(3114, 2396.578613, -3364.160889, 16.960835, 0.0000, 0.0000, 0.0000);
  28.     //carrier ship
  29.     CreateObject(10771, 2339.821777, -3349.019287, 5.724000, 0.0000, 0.0000, 179.9996);
  30.     CreateObject(11145, 2402.685059, -3348.854004, 4.425000, 0.0000, 0.0000, 179.9996);
  31.     CreateObject(11146, 2348.800293, -3349.596436, 12.555000, 0.0000, 0.0000, 179.9996);
  32.     CreateObject(10770, 2336.546631, -3341.439697, 38.907001, 0.0000, 0.0000, 179.9996);
  33.     CreateObject(11237, 2336.677002, -3341.356934, 38.504002, 0.0000, 0.0000, 179.9996);
  34.     CreateObject(11149, 2345.781006, -3343.639893, 12.114000, 0.0000, 0.0000, 179.9996);
  35.     //vehicles
  36.     AddStaticVehicle(520,2386.0637,-3341.1990,19.2313,149.1671,0,0); // hydra carrier
  37.     AddStaticVehicle(520,2397.9280,-3339.8740,19.2333,154.6306,0,0); // hydra carrier
  38.     AddStaticVehicle(425,2290.6882,-3342.1926,19.0844,95.4291,43,0); // hunter carrier
  39.     return 1;
  40. }
  41.  
  42. public OnFilterScriptExit()
  43. {
  44.     return 1;
  45. }
  46.  
  47. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  48. {
  49.     if (newkeys & KEY_CROUCH  && GetVehicleModel(GetPlayerVehicleID(playerid)) == 520)
  50.     {
  51.     new Float:x,Float:y,Float:z;
  52.     GetPlayerPos(playerid,x,y,z);
  53.     CreateExplosion(x,y,z, 12, 6);
  54.     SetPlayerPos(playerid,x,y,z+EjectHeight);
  55.     GivePlayerWeapon(playerid,46,1);
  56.     }
  57.     if (newkeys & 128)
  58.     {
  59.         if (PlayerToPoint(12.5, playerid,2438.869141, -3349.019531, 10.252022) || PlayerToPoint(12.5, playerid,2438.869141, -3349.019531, 17.201916))
  60.         {
  61.             if(lift11 == 0) {
  62.                 MoveObject(lift1,2438.869141, -3349.019531, 10.252022, 1.500000);
  63.                 lift11 = 1;
  64.             }
  65.             else
  66.             {
  67.                 MoveObject(lift1,2438.869141, -3349.019531, 17.201916, 1.500000);
  68.                 lift11 = 0;
  69.             }
  70.         }
  71.     }
  72.     if (newkeys & 128)
  73.     {
  74.         if (PlayerToPoint(11.5, playerid,2396.578613, -3364.160889, 9.910942) || PlayerToPoint(11.5, playerid,2396.578613, -3364.160889, 16.960835))
  75.         {
  76.             if(lift22 == 0) {
  77.                 MoveObject(lift2,2396.578613, -3364.160889, 9.910942, 1.500000);
  78.                 lift22 = 1;
  79.             }
  80.             else
  81.             {
  82.                 MoveObject(lift2,2396.578613, -3364.160889, 16.960835, 1.500000);
  83.                 lift22 = 0;
  84.             }
  85.         }
  86.     }
  87.     if (newkeys & 128)
  88.     {
  89.         if (PlayerToPoint(5.5, playerid,CarrierCatapultX,CarrierCatapultY,CarrierCatapultZ) && GetVehicleModel(GetPlayerVehicleID(playerid)) == 520)
  90.         {
  91.             new Float:velocityx, Float:velocityy, Float:velocityz;
  92.             GetVehicleVelocity(GetPlayerVehicleID(playerid), velocityx, velocityy, velocityz);
  93.             SetVehicleVelocity(GetPlayerVehicleID(playerid), velocityx-CatapultSpeed, velocityy, velocityz);
  94.         }
  95.     }
  96.    
  97.     return 1;
  98. }
  99.  
  100. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  101. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  102. {
  103.     if(IsPlayerConnected(playerid))
  104.     {
  105.         new Float:oldposx, Float:oldposy, Float:oldposz;
  106.         new Float:tempposx, Float:tempposy, Float:tempposz;
  107.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  108.         tempposx = (oldposx -x);
  109.         tempposy = (oldposy -y);
  110.         tempposz = (oldposz -z);
  111.         if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  112.         {
  113.             return 1;
  114.         }
  115.     }
  116.     return 0;
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement