Advertisement
Guest User

Untitled

a guest
May 18th, 2013
2,037
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.56 KB | None | 0 0
  1. //Entering bus as passenger///By Stream
  2. #include <a_samp>
  3.  
  4. new IsInBus[MAX_PLAYERS];
  5. new Timer1[MAX_PLAYERS];
  6. new Timer2[MAX_PLAYERS];
  7. new Timer3[MAX_PLAYERS];
  8.  
  9. public OnFilterScriptInit()
  10. {
  11. CreateObject(2631, 2022.0, 2236.7, 2102.9, 0.0, 0.0, 90.0);
  12. CreateObject(2631, 2022.0, 2240.6, 2102.9, 0.0, 0.0, 90.0);
  13. CreateObject(2631, 2022.0, 2244.5, 2102.9, 0.0, 0.0, 90.0);
  14. CreateObject(2631, 2022.0, 2248.4, 2102.9, 0.0, 0.0, 90.0);
  15. CreateObject(16501, 2022.1, 2238.3, 2102.8, 0.0, 90.0, 0.0);
  16. CreateObject(16501, 2022.1, 2245.3, 2102.8, 0.0, 90.0, 0.0);
  17. CreateObject(16000, 2024.2, 2240.1, 2101.2, 0.0, 0.0, 90.0);
  18. CreateObject(16000, 2019.8, 2240.6, 2101.2, 0.0, 0.0, -90.0);
  19. CreateObject(16000, 2022.2, 2248.7, 2101.2, 0.0, 0.0, 180.0);
  20. CreateObject(16501, 2021.8, 2246.5, 2107.3, 0.0, 270.0, 90.0);
  21. CreateObject(16501, 2022.0, 2240.8, 2107.3, 0.0, 270.0, 0.0);
  22. CreateObject(16501, 2022.0, 2233.7, 2107.3, 0.0, 270.0, 0.0);
  23. CreateObject(18098, 2024.3, 2239.6, 2104.8, 0.0, 0.0, 90.0);
  24. CreateObject(18098, 2024.3, 2239.7, 2104.7, 0.0, 0.0, 450.0);
  25. CreateObject(18098, 2020.1, 2239.6, 2104.8, 0.0, 0.0, 90.0);
  26. CreateObject(18098, 2020.0, 2239.6, 2104.7, 0.0, 0.0, 90.0);
  27. CreateObject(2180, 2023.6, 2236.1, 2106.7, 0.0, 180.0, 90.0);
  28. CreateObject(2180, 2023.6, 2238.1, 2106.7, 0.0, 180.0, 90.0);
  29. CreateObject(2180, 2023.6, 2240.1, 2106.7, 0.0, 180.0, 90.0);
  30. CreateObject(2180, 2023.6, 2242.1, 2106.7, 0.0, 180.0, 90.0);
  31. CreateObject(2180, 2023.6, 2244.1, 2106.7, 0.0, 180.0, 90.0);
  32. CreateObject(2180, 2023.6, 2246.1, 2106.7, 0.0, 180.0, 90.0);
  33. CreateObject(2180, 2023.6, 2248.1, 2106.7, 0.0, 180.0, 90.0);
  34. CreateObject(2180, 2020.3, 2235.1, 2106.7, 0.0, 180.0, 270.0);
  35. CreateObject(2180, 2020.3, 2237.1, 2106.7, 0.0, 180.0, 270.0);
  36. CreateObject(2180, 2020.3, 2239.1, 2106.7, 0.0, 180.0, 270.0);
  37. CreateObject(2180, 2020.3, 2241.1, 2106.7, 0.0, 180.0, 270.0);
  38. CreateObject(2180, 2020.3, 2243.1, 2106.7, 0.0, 180.0, 270.0);
  39. CreateObject(2180, 2020.3, 2245.1, 2106.7, 0.0, 180.0, 270.0);
  40. CreateObject(2674, 2023.4, 2238.3, 2102.9, 0.0, 0.0, 600.0);
  41. CreateObject(2674, 2020.4, 2242.3, 2102.9, 0.0, 0.0, 600.0);
  42. CreateObject(2674, 2023.4, 2246.3, 2102.9, 0.0, 0.0, 600.0);
  43. CreateObject(14405, 2022.0, 2242.1, 2103.5, 0.0, 0.0, 540.0);
  44. CreateObject(14405, 2022.0, 2243.6, 2103.5, 0.0, 0.0, 180.0);
  45. CreateObject(14405, 2022.0, 2245.1, 2103.5, 0.0, 0.0, 180.0);
  46. CreateObject(14405, 2022.0, 2246.6, 2103.5, 0.0, 0.0, 180.0);
  47. CreateObject(14405, 2022.0, 2248.1, 2103.5, 0.0, 0.0, 180.0);
  48. CreateObject(14405, 2022.0, 2249.6, 2103.5, 0.0, 0.0, 180.0);
  49. CreateObject(14405, 2022.0, 2251.1, 2103.5, 0.0, 0.0, 180.0);
  50. CreateObject(14405, 2024.6, 2242.1, 2103.5, 0.0, 0.0, 180.0);
  51. CreateObject(14405, 2024.6, 2243.6, 2103.5, 0.0, 0.0, 180.0);
  52. CreateObject(14405, 2024.6, 2245.1, 2103.5, 0.0, 0.0, 180.0);
  53. CreateObject(14405, 2024.6, 2246.6, 2103.5, 0.0, 0.0, 180.0);
  54. CreateObject(14405, 2024.6, 2248.1, 2103.5, 0.0, 0.0, 180.0);
  55. CreateObject(14405, 2024.6, 2249.6, 2103.5, 0.0, 0.0, 180.0);
  56. CreateObject(14405, 2024.6, 2251.1, 2103.5, 0.0, 0.0, 180.0);
  57. CreateObject(14405, 2019.4, 2242.1, 2103.5, 0.0, 0.0, 180.0);
  58. CreateObject(14405, 2019.4, 2243.6, 2103.5, 0.0, 0.0, 180.0);
  59. CreateObject(14405, 2019.4, 2245.1, 2103.5, 0.0, 0.0, 180.0);
  60. CreateObject(14405, 2019.4, 2246.6, 2103.5, 0.0, 0.0, 180.0);
  61. CreateObject(14405, 2019.4, 2248.1, 2103.5, 0.0, 0.0, 180.0);
  62. CreateObject(14405, 2019.4, 2249.6, 2103.5, 0.0, 0.0, 180.0);
  63. CreateObject(14405, 2019.4, 2251.1, 2103.5, 0.0, 0.0, 180.0);
  64. CreateObject(14405, 2022.0, 2253.6, 2104.0, -6.0, 0.0, 180.0);
  65. CreateObject(14405, 2021.1, 2253.6, 2104.0, -6.0, 0.0, 180.0);
  66. CreateObject(14405, 2024.6, 2253.6, 2103.5, 0.0, 0.0, 180.0);
  67. CreateObject(2674, 2020.4, 2235.7, 2102.9, 0.0, 0.0, 52.0);
  68. CreateObject(2673, 2020.4, 2246.7, 2102.9, 0.0, 0.0, 270.0);
  69. CreateObject(2700, 2023.5, 2235.1, 2105.5, 180.0, -4.0, 90.0);
  70. CreateObject(2700, 2020.4, 2235.1, 2105.5, 180.0, 0.0, 90.0);
  71. CreateObject(2700, 2023.5, 2242.1, 2105.5, 180.0, -4.0, 90.0);
  72. CreateObject(2700, 2020.4, 2242.1, 2105.5, 180.0, 0.0, 90.0);
  73. CreateObject(1799, 2023.1, 2234.2, 2105.7, 270.0, 0.0, 360.0);
  74. CreateObject(1799, 2019.8, 2234.2, 2105.7, 270.0, 0.0, 0.0);
  75. CreateObject(1538, 2022.7, 2234.7, 2102.8, 0.0, 0.0, 180.0);
  76. CreateObject(1799, 2022.1, 2234.2, 2106.1, 720.0, 90.0, 450.0);
  77. CreateObject(1799, 2021.8, 2234.2, 2105.1, 0.0, 270.0, 270.0);
  78. CreateObject(1799, 2022.1, 2234.2, 2107.3, 0.0, 90.0, 90.0);
  79. CreateObject(1799, 2021.6, 2234.2, 2106.3, 0.0, 270.0, 270.0);
  80. CreateObject(1799, 2022.3, 2234.2, 2104.3, 90.0, 0.0, 180.0);
  81.  
  82. return 1;
  83. }
  84.  
  85. public OnFilterScriptExit()
  86. {
  87. return 1;
  88. }
  89.  
  90. public OnPlayerConnect(playerid)
  91. {
  92. IsInBus[playerid] = 0;
  93. return 1;
  94. }
  95.  
  96. public OnPlayerStateChange(playerid, newstate, oldstate)
  97. {
  98. new vehicleid = GetPlayerVehicleID(playerid);
  99. if(newstate == PLAYER_STATE_PASSENGER)
  100. {
  101. if (GetVehicleModel(vehicleid) == 431 || GetVehicleModel(vehicleid) == 437)
  102. {
  103. SetPlayerPos(playerid, 2022.0273, 2235.2402, 2103.9536);
  104. SetPlayerTime(playerid, 00,00);
  105. SetPlayerFacingAngle(playerid, 0);
  106. SetCameraBehindPlayer(playerid);
  107. SetPlayerInterior(playerid, 1);
  108. Timer1[playerid] = SetTimerEx("HornA", 60000, 1, "i", playerid);
  109. Timer2[playerid] = SetTimerEx("HornB", 60500, 1, "i", playerid);
  110. Timer3[playerid] = SetTimerEx("STime", 60000, 1, "i", playerid);
  111. IsInBus[playerid] = vehicleid;
  112. }
  113. }
  114. return 1;
  115. }
  116.  
  117. forward HornA(playerid);
  118. forward HornB(playerid);
  119. forward STime(playerid);
  120.  
  121. public HornA(playerid)
  122. {
  123. new Float:X, Float:Y, Float:Z;
  124. GetPlayerPos(playerid, X, Y, Z);
  125. PlayerPlaySound(playerid, 1147, X, Y, Z);
  126. }
  127.  
  128. public HornB(playerid)
  129. {
  130. new Float:X, Float:Y, Float:Z;
  131. GetPlayerPos(playerid, X, Y, Z);
  132. PlayerPlaySound(playerid, 1147, X, Y+5, Z);
  133. }
  134.  
  135. public STime(playerid)
  136. {
  137. SetPlayerTime(playerid, 00,00);
  138. }
  139.  
  140. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  141. {
  142. if (newkeys == 16 && IsInBus[playerid] > 0)
  143. {
  144. new Float:X,Float:Y,Float:Z;
  145. GetVehiclePos(IsInBus[playerid], X, Y, Z);
  146. SetPlayerPos(playerid, X+4, Y, Z);
  147. SetPlayerInterior(playerid, 0);
  148. KillTimer(Timer1[playerid]);
  149. KillTimer(Timer2[playerid]);
  150. IsInBus[playerid] = 0;
  151. }
  152. return 1;
  153. }
  154.  
  155. public OnPlayerDeath(playerid, killerid, reason)
  156. {
  157. if(IsInBus[playerid] == 1)
  158. {
  159. IsInBus[playerid] = 0;
  160. KillTimer(Timer1[playerid]);
  161. KillTimer(Timer2[playerid]);
  162. }
  163. return 1;
  164. }
  165.  
  166. public OnPlayerDisconnect(playerid, reason)
  167. {
  168. IsInBus[playerid] = 0;
  169. return 1;
  170. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement