Advertisement
n0minal

Pedágio by n0minal

Apr 13th, 2013
1,688
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.16 KB | None | 0 0
  1. /*
  2. Filterscript criado por n0minal
  3. */
  4. #include <a_samp>
  5.  
  6. #define FILTERSCRIPT
  7. #define COLOR_YELLOW 0xFFFF00AA
  8. #define COLOR_BLUE 0x2641FEAA
  9. #define KEY_HORN 2
  10.  
  11. new portao[9];
  12. new Pickup[9];
  13.  
  14. public OnFilterScriptInit()
  15. {
  16. print("\n--------------------------------------");
  17. print(" [ FS ] Pedagios: criado por n0minal! ");
  18. print("--------------------------------------\n");
  19.  
  20. Create3DTextLabel("Pedágio: Aperte H para liberar o caminho!",0xff0000ff, 71.9957,-1534.3894,5.2046,25.0,0);
  21. Create3DTextLabel("Pedágio: Aperte H para liberar o caminho!",0xff0000ff, 59.5030,-1532.9253,5.2139,25.0,0);
  22. Create3DTextLabel("Pedágio: Aperte H para liberar o caminho!",0xff0000ff, 1740.2538,505.0170,28.8597,25.0,0);
  23. Create3DTextLabel("Pedágio: Aperte H para liberar o caminho!",0xff0000ff, 1728.5652,515.0717,28.5365,25.0,0);
  24. Create3DTextLabel("Pedágio: Aperte H para liberar o caminho!",0xff0000ff, -2681.8362,1280.4871,55.9456,25.0,0);
  25. Create3DTextLabel("Pedágio: Aperte H para liberar o caminho!",0xff0000ff, -1404.3192,811.3879,47.3449,25.0,0);
  26. Create3DTextLabel("Pedágio: Aperte H para liberar o caminho!",0xff0000ff, -1411.8649,822.5869,47.3678,25.0,0);
  27. Create3DTextLabel("Pedágio: Aperte H para liberar o caminho!",0xff0000ff, -2681.8472,1268.6603,55.9456,25.0,0);
  28.  
  29. Pickup[1] = CreatePickup(1239, 1, 71.9957,-1534.3894,5.2046);
  30. Pickup[2] = CreatePickup(1239, 1, 59.5030,-1532.9253,5.2139);
  31. Pickup[3] = CreatePickup(1239, 1, 1740.2538,505.0170,28.8597);
  32. Pickup[4] = CreatePickup(1239, 1, 1728.5652,515.0717,28.5365);
  33. Pickup[5] = CreatePickup(1239, 1, -2681.8362,1280.4871,55.9456);
  34. Pickup[6] = CreatePickup(1239, 1, -1404.3192,811.3879,47.3449);
  35. Pickup[7] = CreatePickup(1239, 1, -1411.8649,822.5869,47.3678);
  36. Pickup[8] = CreatePickup(1239, 1, -2681.8472,1268.6603,55.9456);
  37. //Pedágio Rodeo
  38. portao[1] = CreateObject(968, 67.83, -1529.78, 4.79, 0.00, 90.00, 90.00);//da direita
  39. portao[2] = CreateObject(968, 67.47, -1537.44, 4.79, 0.00, 90.00, -90.00);//da esquerda
  40. //Pedágio Los Santos
  41. portao[3] = CreateObject(968, 1731.04, 511.49, 28.48, 0.00, -90.00, -20.00);//da esquerda
  42. portao[4] = CreateObject(968, 1738.09, 509.31, 28.57, 0.00, 90.00, -20.00);//da direita
  43. //Pedágio San Fierro
  44. portao[5] = CreateObject(968, -1411.68, 818.56, 47.18, 360.00, -90.00, -48.40);//da esquerda
  45. portao[6] = CreateObject(968, -1404.05, 817.20, 47.18, 360.00, 90.00, -48.40);//da direita
  46. //Pedágio Bayside
  47. portao[7] = CreateObject(968, -2689.38, 1269.53, 55.45, 0.00, 90.00, 0.00);//da direita
  48. portao[8] = CreateObject(968, -2673.69, 1279.64, 55.45, 0.00, -90.00, 0.00);//da esquerda
  49. //objects portao1 e 2
  50. CreateObject(7033, 65.927567, -1533.642700, 8.355223, 0.8594, 0.0000, 83.3654);
  51. CreateObject(3877, 67.976868, -1531.783813, 5.551031, 0.0000, 0.0000, 353.9839);
  52. CreateObject(3877, 68.430626, -1522.038086, 5.578691, 0.0000, 0.0000, 356.5623);
  53. CreateObject(3877, 67.3796, -1545.6030, 5.6980, 0.0000, 0.0000, 356.5623);
  54. CreateObject(3877, 67.5600, -1536.3228, 5.7063, 0.0000, 0.0000, 354.8434);
  55. CreateObject(3864, 75.874809, -1534.855957, 10.345168, 0.0000, 0.0000, 173.5018);
  56. CreateObject(3864, 56.145210, -1532.551636, 10.351826, 0.0000, 0.0000, 353.9837);
  57. CreateObject(3877, 28.482025, -1527.640137, 5.680993, 0.0000, 0.0000, 351.4056);
  58. CreateObject(3877, 19.857996, -1525.820435, 5.018308, 0.0000, 0.0000, 348.8273);
  59. CreateObject(3877, 13.395845, -1524.428955, 4.614534, 0.0000, 0.0000, 348.8273);
  60. CreateObject(966, 67.82, -1530.09, 3.97, 0.00, 0.00, -90.00);
  61. CreateObject(3877, 68.02, -1530.89, 5.58, 0.00, 0.00, 356.56);
  62. CreateObject(3877, 67.40, -1544.83, 5.70, 0.00, 0.00, 356.56);
  63. CreateObject(966, 67.46, -1537.25, 3.97, 0.00, 0.00, 90.00);
  64.  
  65. //objects portao3 e 4
  66. CreateObject(7033, 1735.2945556641, 512.66381835938, 31.834371566772, 0, 0, 339.99938964844);
  67. CreateObject(987, 1722.28125, 511.55117797852, 27.720676422119, 0, 4, 71.998901367188);
  68. CreateObject(987, 1726.1037597656, 523.12225341797, 26.624887466431, 0, 0, 113.99719238281);
  69. CreateObject(987, 1748.6484375, 514.7958984375, 27.250556945801, 0, 0, 249.99389648438);
  70. CreateObject(987, 1758.2679443359, 520.96795654297, 26.054347991943, 0, 356, 217.98910522461);
  71. CreateObject(987, 1711.2819824219, 503.29724121094, 28.032232284546, 0, 0, 31.997680664063);
  72. CreateObject(987, 1744.3728027344, 502.07650756836, 28.077571868896, 0, 0, 291.99621582031);
  73. CreateObject(1237, 1723.8087158203, 514.22821044922, 27.671068191528, 0, 0, 0);
  74. CreateObject(1237, 1745.0375976563, 506.91006469727, 27.669532775879, 0, 0, 0);
  75. CreateObject(966, 1737.81, 509.46, 27.72, 0.00, 0.00, -200.00);
  76. CreateObject(1237, 1737.02, 509.86, 27.67, 0.00, 0.00, 0.00);
  77. CreateObject(966, 1731.37, 511.36, 27.72, 0.00, 0.00, -20.00);
  78. CreateObject(1237, 1732.19, 511.12, 27.67, 0.00, 0.00, 0.00);
  79. //objects portao5 e 6
  80. CreateObject(7033, -1407.8485107422, 817.6396484375, 50.383720397949, 0, 0, 316);
  81. CreateObject(987, -1420.9528808594, 821.13604736328, 45.69006729126, 0, 0, 48);
  82. CreateObject(987, -1395.7629394531, 813.71850585938, 46.307685852051, 0, 0, 227.99877929688);
  83. /////////////////////Isolamento (Direita)///////////////////////
  84. CreateObject(1237, -1399.09, 811.54, 46.65, 0.00, 0.00, 0.00);
  85. CreateObject(1237, -1402.26, 802.61, 46.65, 0.00, 0.00, 0.00);
  86. CreateObject(1237, -1403.02, 803.24, 46.65, 0.00, 0.00, 0.00);
  87. CreateObject(1237, -1401.48, 801.88, 46.65, 0.00, 0.00, 0.00);
  88. CreateObject(1237, -1401.19, 800.47, 46.65, 0.00, 0.00, 0.00);
  89. CreateObject(1237, -1400.38, 799.64, 46.65, 0.00, 0.00, 0.00);
  90. CreateObject(1237, -1399.56, 798.87, 46.65, 0.00, 0.00, 0.00);
  91. CreateObject(1237, -1393.13, 813.65, 46.65, 0.00, 0.00, 0.00);
  92. CreateObject(1237, -1392.60, 812.81, 46.65, 0.00, 0.00, 0.00);
  93. CreateObject(1237, -1391.96, 811.99, 46.65, 0.00, 0.00, 0.00);
  94. CreateObject(1237, -1391.35, 811.14, 46.65, 0.00, 0.00, 0.00);
  95. CreateObject(1237, -1390.64, 810.44, 46.65, 0.00, 0.00, 0.00);
  96. CreateObject(1237, -1389.93, 809.79, 46.65, 0.00, 0.00, 0.00);
  97. CreateObject(1237, -1389.39, 809.00, 46.65, 0.00, 0.00, 0.00);
  98. CreateObject(1237, -1416.72, 824.44, 46.26, 0.00, 0.00, 0.00);
  99. ////////////////////Isolamento (Esquerda)///////////////////////
  100. CreateObject(1237, -1410.90, 817.78, 46.26, 0.00, 0.00, 0.00);
  101. CreateObject(1237, -1422.30, 822.09, 46.26, 0.00, 0.00, 0.00);
  102. CreateObject(1237, -1423.13, 822.63, 46.26, 0.00, 0.00, 0.00);
  103. CreateObject(1237, -1423.86, 823.43, 46.26, 0.00, 0.00, 0.00);
  104. CreateObject(1237, -1424.65, 823.99, 46.26, 0.00, 0.00, 0.00);
  105. CreateObject(1237, -1425.37, 824.55, 46.26, 0.00, 0.00, 0.00);
  106. CreateObject(1237, -1426.14, 825.08, 46.26, 0.00, 0.00, 0.00);
  107. CreateObject(1237, -1426.94, 825.67, 46.26, 0.00, 0.00, 0.00);
  108. CreateObject(1237, -1412.89, 831.84, 46.26, 0.00, 0.00, 0.00);
  109. CreateObject(1237, -1413.88, 832.35, 46.26, 0.00, 0.00, 0.00);
  110. CreateObject(1237, -1414.72, 833.13, 46.26, 0.00, 0.00, 0.00);
  111. CreateObject(1237, -1415.56, 833.77, 46.26, 0.00, 0.00, 0.00);
  112. CreateObject(1237, -1416.23, 834.44, 46.26, 0.00, 0.00, 0.00);
  113. CreateObject(1237, -1416.94, 835.09, 46.26, 0.00, 0.00, 0.00);
  114. CreateObject(1237, -1417.77, 835.57, 46.26, 0.00, 0.00, 0.00);
  115. ///////////////////////////////////////////////////////////////
  116. CreateObject(966, -1404.27, 817.43, 46.37, 0.00, 0.00, -228.75);
  117. CreateObject(966, -1411.50, 818.28, 46.37, 0.00, 0.00, 311.40);
  118. //objects portao7 e 8
  119. CreateObject(987, -2672.3884277344, 1270.6895751953, 54.004661560059, 0, 0, 322.25);
  120. CreateObject(987, -2699.5107421875, 1262.8109130859, 53.97966003418, 0, 0, 41.745483398438);
  121. CreateObject(966, -2689.74, 1269.53, 54.65, 0.00, 0.00, 180.00);
  122. CreateObject(966, -2673.35, 1279.63, 54.70, 0.00, 0.00, 0.00);
  123. CreateObject(987, -2699.57, 1283.15, 53.98, 0.00, 0.00, -41.75);
  124. CreateObject(987, -2672.73, 1277.73, 54.00, 0.00, 0.00, -322.25);
  125. return 1;
  126. }
  127.  
  128. public OnFilterScriptExit()
  129. {
  130. return 1;
  131. }
  132.  
  133. public OnPlayerConnect(playerid)
  134. {
  135. RemoveBuildingForPlayer(playerid, 1283, 73.8125, -1543.1250, 7.5313, 0.25);//portão 1 e 2
  136. return 1;
  137. }
  138.  
  139. public OnPlayerPickUpPickup(playerid, pickupid)
  140. {
  141. if(pickupid == Pickup[1] || pickupid == Pickup[2]|| pickupid == Pickup[3] || pickupid == Pickup[4]
  142. pickupid == Pickup[5] || pickupid == Pickup[6] || pickupid == Pickup[7] || pickupid == Pickup[8])
  143. {
  144. SendClientMessage(playerid, 0xADFF2FAA, "~~~~~~~~~~~~~~~~~~~~~~~ Pedágio ~~~~~~~~~~~~~~~~~~~~~~~~~~");
  145. SendClientMessage(playerid, 0xFFFFFFAA, "Entre no seu carro e aperte H para liberar o caminho!");
  146. SendClientMessage(playerid, 0xFFFFFFAA, "A cancela fecha 2 segundos depois de aberta.");
  147. SendClientMessage(playerid, 0xFFFFFFAA, "A passagem custa $15 tenha uma boa viagem.");
  148. SendClientMessage(playerid, 0xADFF2FAA, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  149. }
  150. return 1;
  151. }
  152.  
  153. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  154. {
  155. if(IsPlayerInRangeOfPoint(playerid, 10, -1412.3848, 812.9502, 47.7167))
  156. {
  157. if ((newkeys & KEY_HORN ) && !(oldkeys & KEY_HORN ))
  158. {
  159. MoveObject(portao[6],-1404.05, 817.20, 47.18, 5.5, 360.00, 0.00, -48.40);
  160. SetTimer("GateClose6", 2000, 0);
  161. SendClientMessage(playerid, COLOR_BLUE,"| INFO | Pedagio pago 15$ tenha uma boa viagem e dirija com cuidado.");
  162. GivePlayerMoney(playerid,-15);
  163. }
  164. return 1;
  165. }
  166.  
  167. //////////////////////////////////////////////////////////////////////////////////////////////////////////
  168. if(IsPlayerInRangeOfPoint(playerid, 10, -1403.4413,822.1852,47.8172))
  169. {
  170. if ((newkeys & KEY_HORN ) && !(oldkeys & KEY_HORN ))
  171. {
  172. MoveObject(portao[5], -1411.68, 818.56, 47.18, 5.5, 360.00, 0.00, -48.40);
  173. SetTimer("GateClose5", 2000, 0);
  174. SendClientMessage(playerid, COLOR_BLUE,"| INFO | Pedagio pago 15$ tenha uma boa viagem e dirija com cuidado.");
  175. GivePlayerMoney(playerid,-15);
  176. }
  177. return 1;
  178. }
  179. ///////////////////////////////////////////////////////////////////////////////////////////////////////////
  180. if(IsPlayerInRangeOfPoint(playerid, 10, -2677.1943, 1282.1063, 54.4258))
  181. {
  182. if ((newkeys & KEY_HORN ) && !(oldkeys & KEY_HORN ))
  183. {
  184. MoveObject(portao[8],-2673.69, 1279.64, 55.45, 5.5, 0.00, 0.00, 0.00);//portão da direita
  185. SetTimer("GateClose8", 2000, 0);
  186. SendClientMessage(playerid, COLOR_BLUE,"| INFO | Pedagio pago 15$ tenha uma boa viagem e dirija com cuidado.");
  187. GivePlayerMoney(playerid,-15);
  188. }
  189. return 1;
  190. }
  191. ///////////////////////////////////////////////////////////////////////////////////////////////////////////
  192. if(IsPlayerInRangeOfPoint(playerid, 10, -2687.3574, 1272.3484, 55.3856))
  193. {
  194. if ((newkeys & KEY_HORN ) && !(oldkeys & KEY_HORN ))
  195. {
  196. MoveObject(portao[7], -2689.38, 1269.53, 55.45, 5.5, 0.00, 0.00, 0.00);//portão da esquerda
  197. SetTimer("GateClose7", 2000, 0);
  198. SendClientMessage(playerid, COLOR_BLUE,"| INFO | Pedagio pago 15$ tenha uma boa viagem e dirija com cuidado.");
  199. GivePlayerMoney(playerid,-15);
  200. }
  201. return 1;
  202. }
  203. //////////////////////////////////////////////////////////////////////////////////////////////////////////
  204. if(IsPlayerInRangeOfPoint(playerid, 10, 71.9957,-1534.3894,5.2046))
  205. {
  206. if ((newkeys & KEY_HORN ) && !(oldkeys & KEY_HORN ))
  207. {
  208. MoveObject(portao[1],67.83, -1529.78, 4.79, 5.5, 0.00, 0.00, 90.00);//portão da direita
  209. SetTimer("GateClose1", 2000, 0);
  210. SendClientMessage(playerid, COLOR_BLUE,"| INFO | Pedagio pago 15$ tenha uma boa viagem e dirija com cuidado.");
  211. GivePlayerMoney(playerid,-15);
  212. }
  213. return 1;
  214. }
  215. //////////////////////////////////////////////////////////////////////////////////////////////////////////
  216. if(IsPlayerInRangeOfPoint(playerid, 10, 63.0989,-1540.5431,5.0593))
  217. {
  218. if ((newkeys & KEY_HORN ) && !(oldkeys & KEY_HORN ))
  219. {
  220. MoveObject(portao[2], 67.47, -1537.44, 4.79, 5.5, 0.00, 0.0, -90.0);//portão da esquerda
  221. SetTimer("GateClose2", 2000, 0);
  222. SendClientMessage(playerid, COLOR_BLUE,"| INFO | Pedaggio pago 15$ tenha uma boa viagem e dirija com cuidado.");
  223. GivePlayerMoney(playerid,-15);
  224. }
  225. return 1;
  226. }
  227. //////////////////////////////////////////////////////////////////////////////////////////////////////////
  228. if(IsPlayerInRangeOfPoint(playerid, 10, 1733.1107,506.8286,28.9694))
  229. {
  230. if ((newkeys & KEY_HORN ) && !(oldkeys & KEY_HORN ))
  231. {
  232. MoveObject(portao[4], 1738.09, 509.31, 28.57, 5.5, 0.00, 0.00, -20.00);//portão da direita
  233. SetTimer("GateClose4", 2000, 0);
  234. SendClientMessage(playerid, COLOR_BLUE,"| INFO | Pedagio pago 15$ tenha uma boa viagem e dirija com cuidado.");
  235. GivePlayerMoney(playerid,-15);
  236. }
  237. return 1;
  238. }
  239. //////////////////////////////////////////////////////////////////////////////////////////////////////////
  240. if(IsPlayerInRangeOfPoint(playerid, 10, 1737.4161,518.6452,28.1503))
  241. {
  242. if ((newkeys & KEY_HORN ) && !(oldkeys & KEY_HORN ))
  243. {
  244. MoveObject(portao[3],1731.04, 511.49, 28.48, 5.5, 0.00, 0.00, -20.00);//portão da esquerda
  245. SetTimer("GateClose3", 2000, 0);
  246. SendClientMessage(playerid, COLOR_BLUE,"| INFO | Pedagio pago 15$ tenha uma boa viagem e dirija com cuidado.");
  247. GivePlayerMoney(playerid,-15);
  248. }
  249. return 1;
  250. }
  251. //////////////////////////////////////////////////////////////////////////////////////////////////////////
  252. return 1;
  253. }
  254.  
  255. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  256. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  257. {
  258. if(IsPlayerConnected(playerid))
  259. {
  260. new Float:oldposx, Float:oldposy, Float:oldposz;
  261. new Float:tempposx, Float:tempposy, Float:tempposz;
  262. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  263. tempposx = (oldposx -x);
  264. tempposy = (oldposy -y);
  265. tempposz = (oldposz -z);
  266. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  267. {
  268. return 1;
  269. }
  270. }
  271. return 0;
  272. }
  273. forward GateClose1();
  274. public GateClose1()
  275. {
  276. MoveObject (portao[1],67.83, -1529.78, 4.79, 2.5, 0.00, 90.00, 90.00);//
  277. return 1;
  278. }
  279. forward GateClose2();
  280. public GateClose2()
  281. {
  282. MoveObject (portao[2],67.47, -1537.44, 4.79, 2.5, 0.00, 90.00, -90.00);//
  283. return 1;
  284. }
  285. forward GateClose3();
  286. public GateClose3()
  287. {
  288. MoveObject (portao[3],1731.04, 511.49, 28.48, 2.5, 0.00, -90.00, -20.00);//
  289. return 1;
  290. }
  291. forward GateClose4();
  292. public GateClose4()
  293. {
  294. MoveObject (portao[4],1738.09, 509.31, 28.57, 2.5, 0.00, 90.00, -20.00);//
  295. return 1;
  296. }
  297. forward GateClose5();
  298. public GateClose5()
  299. {
  300. MoveObject (portao[5],-1411.68, 818.56, 47.18, 2.5, 360.00, -90.00, -48.40);//
  301. return 1;
  302. }
  303. forward GateClose6();
  304. public GateClose6()
  305. {
  306. MoveObject (portao[6],-1404.05, 817.20, 47.18, 2.5, 360.00, 90.00, -48.40);//
  307. return 1;
  308. }
  309. forward GateClose7();
  310. public GateClose7()
  311. {
  312. MoveObject (portao[7],-2689.38, 1269.53, 55.45, 2.5, 0.00, 90.00, 0.00);//
  313. return 1;
  314. }
  315. forward GateClose8();
  316. public GateClose8()
  317. {
  318. MoveObject (portao[8],-2673.69, 1279.64, 55.45, 2.5, 0.00, -90.00, 0.00);//
  319. return 1;
  320. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement