Guest User

Seif

a guest
Oct 20th, 2008
974
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.                             Hydra Passenger Seat filterscript by Seif
  3. */
  4. /*x---------------------------------Important-------------------------------------x*/
  5. //**INCLUDES**//
  6. #include <a_samp>
  7. //**PRAGMAS**//
  8.  
  9. //**MISC**//
  10.  
  11. /*x---------------------------------Defining-------------------------------------x*/
  12. //**COLORS*//
  13. #define GREEN           0x21DD00FF
  14. #define RED             0xE60000FF
  15. #define ADMIN_RED       0xFB0000FF
  16. #define YELLOW          0xFFFF00FF
  17. #define ORANGE          0xF97804FF
  18. #define LIGHTRED        0xFF8080FF
  19. #define LIGHTBLUE       0x00C2ECFF
  20. #define PURPLE          0xB360FDFF
  21. #define PLAYER_COLOR    0xFFFFFFFF
  22. #define BLUE            0x1229FAFF
  23. #define LIGHTGREEN      0x38FF06FF
  24. #define DARKPINK        0xE100E1FF
  25. #define DARKGREEN       0x008040FF
  26. #define ANNOUNCEMENT    0x6AF7E1FF
  27. #define COLOR_SYSTEM    0xEFEFF7AA
  28. #define GREY            0xCECECEFF
  29. #define PINK            0xD52DFFFF
  30. #define DARKGREY        0x626262FF
  31. #define AQUAGREEN       0x03D687FF
  32. #define NICESKY         0x99FFFFAA
  33. #define WHITE           0xFFFFFFFF
  34. //**MISC**//
  35.  
  36. //**VARIABLES**//
  37. new bool:IsInHydra[MAX_PLAYERS];
  38. new PlayerHydra[MAX_PLAYERS];
  39. // **FORWARDS** //
  40.  
  41. /*x---------------------------------CallBacks-------------------------------------x*/
  42. public OnFilterScriptInit()
  43. {
  44.     print("<|-----------------------------------------|>");
  45.     print("  .:[ - Hydra Passenger Seat by Seif - ]:.");
  46.     print("<|-----------------------------------------|>");
  47.     for(new i; i < MAX_PLAYERS; i++) IsInHydra[i] = false;
  48.     return 1;
  49. }
  50.  
  51. public OnFilterScriptExit()
  52. {
  53.     return 1;
  54. }
  55.  
  56. public OnPlayerRequestClass(playerid, classid)
  57. {
  58.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  59.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  60.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  61.     return 1;
  62. }
  63.  
  64. public OnPlayerRequestSpawn(playerid)
  65. {
  66.     return 1;
  67. }
  68.  
  69. public OnPlayerConnect(playerid)
  70. {
  71.     IsInHydra[playerid] = false;
  72.     return 1;
  73. }
  74.  
  75. public OnPlayerDisconnect(playerid, reason)
  76. {
  77.     IsInHydra[playerid] = false;
  78.     return 1;
  79. }
  80.  
  81. public OnPlayerSpawn(playerid)
  82. {
  83.     IsInHydra[playerid] = false;
  84.     return 1;
  85. }
  86.  
  87. public OnPlayerDeath(playerid, killerid, reason)
  88. {
  89.     return 1;
  90. }
  91.  
  92. public OnVehicleSpawn(vehicleid)
  93. {
  94.     return 1;
  95. }
  96.  
  97. public OnVehicleDeath(vehicleid, killerid)
  98. {
  99.     if (GetVehicleModel(vehicleid) == 520)
  100.     {
  101.         for(new i; i < GetMaxPlayers(); i++)
  102.         {
  103.             if (IsPlayerConnected(i))
  104.             {
  105.                 if (IsInHydra[i] == true)
  106.                 {
  107.                     if (PlayerHydra[i] == vehicleid)
  108.                     {
  109.                         TogglePlayerSpectating(i, false);
  110.                         new Float:X,Float:Y,Float:Z,Float:A;
  111.                         GetVehiclePos(vehicleid, X, Y, Z);
  112.                         GetVehicleZAngle(vehicleid, A);
  113.                         X += (2 * floatsin(-A, degrees));
  114.                         Y += (2 * floatcos(-A, degrees));
  115.                         SetPlayerPos(i, X, Y, Z);
  116.                         X += (2 * floatsin(-(A-45.0), degrees));
  117.                         Y += (2 * floatcos(-(A-45.0), degrees));
  118.                         SetPlayerPos(i, X, Y, Z);
  119.                         SetPlayerPos(i, X, Y, Z);
  120.                         SetPlayerFacingAngle(i, A+90);
  121.                         SetCameraBehindPlayer(i);
  122.                         IsInHydra[i] = false;
  123.                         PlayerHydra[i] = 0;
  124.                         SetPlayerHealth(i, 0.0);
  125.                     }
  126.                 }
  127.             }
  128.         }
  129.     }
  130.     IsInHydra[killerid] = false;
  131.     PlayerHydra[killerid] = 0;
  132.     return 1;
  133. }
  134.  
  135. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  136. {
  137.     if (GetVehicleModel(vehicleid) == 520)
  138.     {
  139.         if (ispassenger)
  140.         {
  141.             if (IsInHydra[playerid] == false)
  142.             {
  143.                 TogglePlayerSpectating(playerid, true);
  144.                 PlayerSpectateVehicle(playerid, vehicleid);
  145.                 IsInHydra[playerid] = true;
  146.                 PlayerHydra[playerid] = vehicleid;
  147.             }
  148.         }
  149.     }
  150.     return 1;
  151. }
  152.  
  153. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  154. {
  155.     if (GetVehicleModel(PlayerHydra[playerid]) == 520)
  156.     {
  157.         new vehicleid = PlayerHydra[playerid];
  158.         if (IsInHydra[playerid] == true)
  159.         {
  160.             if (newkeys & KEY_SECONDARY_ATTACK)
  161.             {
  162.                 TogglePlayerSpectating(playerid, false);
  163.                 new Float:X,Float:Y,Float:Z,Float:A;
  164.                 GetVehiclePos(vehicleid, X, Y, Z);
  165.                 GetVehicleZAngle(vehicleid, A);
  166.                 X += (2 * floatsin(-A, degrees));
  167.                 Y += (2 * floatcos(-A, degrees));
  168.                 SetPlayerPos(playerid, X, Y, Z);
  169.                 X += (2 * floatsin(-(A-45.0), degrees));
  170.                 Y += (2 * floatcos(-(A-45.0), degrees));
  171.                 SetPlayerPos(playerid, X, Y, Z);
  172.                 SetPlayerFacingAngle(playerid, A);
  173.                 SetCameraBehindPlayer(playerid);
  174.                 IsInHydra[playerid] = false;
  175.                 PlayerHydra[playerid] = 0;
  176.             }
  177.         }
  178.     }
  179.     return 1;
  180. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×