Advertisement
Guest User

Toll gates

a guest
Jun 26th, 2012
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.33 KB | None | 0 0
  1. #include <a_samp>
  2. //#if defined FILTERSCRIPT
  3. new gates1;
  4. new gates2;
  5. new gates3;
  6. new gates4;
  7. new gates5;
  8. new gates6;
  9. new gates7;
  10. new gates8;
  11. #define grey 0xB4B4B4FF
  12.  
  13. public OnFilterScriptInit()
  14. {
  15. SetTimer("Gates1Check", 500, true);
  16. SetTimer("Gates2Check", 500, true);
  17. SetTimer("Gates3Check", 500, true);
  18. SetTimer("Gates4Check", 500, true);
  19. SetTimer("Gates5Check", 500, true);
  20. SetTimer("Gates6Check", 500, true);
  21. SetTimer("Gates7Check", 500, true);
  22. SetTimer("Gates8Check", 500, true);
  23.  
  24.  
  25. gates1 = CreateObject(8674, 1780.80004883, 701.40002441, 15.80000019, 0.00000000, 0.00000000, 352.00000000);
  26. gates2 = CreateObject(8674, 1795.40002441, 713.09997559, 14.89999962, 0.00000000, 0.00000000, 354.00000000);
  27. gates3 = CreateObject(971, -2667.80004883, 1277.90002441, 56.29999924, 0.00000000, 0.00000000, 0.00000000);
  28. gates4 = CreateObject(971, -2677.30004883, 1277.59997559, 56.29999924, 0.00000000, 0.00000000, 0.00000000);
  29. gates5 = CreateObject(971, -2686.19995117, 1271.50000000, 56.29999924, 0.00000000, 0.00000000, 178.00000000);
  30. gates6 = CreateObject(971, -2695.39990234, 1270.59997559, 56.20000076, 0.00000000, 0.00000000, 178.00000000);
  31. gates7 = CreateObject(975, -1674.90002441, 548.09997559, 38.90000153, 0.00000000, 0.00000000, 318.00000000);
  32. gates8 = CreateObject(975, -1658.19995117, 545.09997559, 38.90000153, 0.00000000, 0.00000000, 136.00000000);
  33.  
  34.  
  35. //gate = CreateObject(Model id, x, y, z, rx, ry, rz); = How to set up the gate. Use the closed position
  36. return 1;
  37. }
  38.  
  39. forward Gates1Check(playerid);
  40. public Gates1Check(playerid)
  41. {
  42. new gates1_status;
  43. for(new all = 0;all<MAX_PLAYERS;all++)
  44. {
  45. if(!IsPlayerConnected(all)) continue;
  46. if(IsPlayerInRangeOfPoint(all,10.0, 1780.80004883, 701.40002441, 15.80000019))gates1_status=1;
  47. {
  48. GivePlayerMoney(playerid,-20);
  49. SendClientMessage(playerid,0xFFFAAA,"You Have paid for toll.");
  50. }
  51. }
  52. if(gates1_status)MoveObject(gates1, 1780.69995117, 701.40002441, 12.80000019, 0.5);
  53. else MoveObject(gates1, 1780.80004883, 701.40002441, 15.80000019, 6.5);
  54. return;
  55. }
  56.  
  57. forward Gates2Check(playerid);
  58. public Gates2Check(playerid)
  59. {
  60. new gates2_status;
  61. for(new all = 0;all<MAX_PLAYERS;all++)
  62. {
  63. if(!IsPlayerConnected(all)) continue;
  64. if(IsPlayerInRangeOfPoint(all,10.0, 1795.40002441, 713.09997559, 14.89999962))gates2_status=1;
  65. }
  66. if(gates2_status)MoveObject(gates2, 1795.40002441, 713.09997559, 12.00000000, 0.5);
  67. else MoveObject(gates2, 1795.40002441, 713.09997559, 14.89999962, 6.5);
  68. return;
  69. }
  70. forward Gates3Check(playerid);
  71. public Gates3Check(playerid)
  72. {
  73. new gates3_status;
  74. for(new all = 0;all<MAX_PLAYERS;all++)
  75. {
  76. if(!IsPlayerConnected(all)) continue;
  77. if(IsPlayerInRangeOfPoint(all,10.0, -2667.80004883, 1277.90002441, 56.29999924))gates3_status=1;
  78. {
  79. GivePlayerMoney(playerid,-20);
  80. SendClientMessage(playerid,0xFFFAAA,"You Have paid for toll.");
  81. }
  82. }
  83. if(gates3_status)MoveObject(gates3, -2667.80004883, 1277.90002441, 48.59999847, 1.0);
  84. else MoveObject(gates3, -2667.80004883, 1277.90002441, 56.29999924, 6.5);
  85. return;
  86. }
  87. forward Gates4Check(playerid);
  88. public Gates4Check(playerid)
  89. {
  90. new gates4_status;
  91. for(new all = 0;all<MAX_PLAYERS;all++)
  92. {
  93. if(!IsPlayerConnected(all)) continue;
  94. if(IsPlayerInRangeOfPoint(all,10.0, -2677.30004883, 1277.59997559, 56.29999924))gates4_status=1;
  95. {
  96. GivePlayerMoney(playerid,-20);
  97. SendClientMessage(playerid,0xFFFAAA,"You Have paid for toll.");
  98. }
  99. }
  100. if(gates4_status)MoveObject(gates4, -2677.30004883, 1277.59997559, 48.09999847, 1.0);
  101. else MoveObject(gates4, -2677.30004883, 1277.59997559, 56.29999924, 6.5);
  102. return;
  103. }
  104. forward Gates5Check(playerid);
  105. public Gates5Check(playerid)
  106. {
  107. new gates5_status;
  108. for(new all = 0;all<MAX_PLAYERS;all++)
  109. {
  110. if(!IsPlayerConnected(all)) continue;
  111. if(IsPlayerInRangeOfPoint(all,10.0, -2686.19995117, 1271.50000000, 56.29999924))gates5_status=1;
  112. {
  113. GivePlayerMoney(playerid,-20);
  114. SendClientMessage(playerid,0xFFFAAA,"You Have paid for toll.");
  115. }
  116. }
  117. if(gates5_status)MoveObject(gates5, -2686.19995117, 1271.50000000, 47.79999924, 1.0);
  118. else MoveObject(gates5, -2686.19995117, 1271.50000000, 56.29999924, 6.5);
  119. return;
  120. }
  121. forward Gates6Check(playerid);
  122. public Gates6Check(playerid)
  123. {
  124. new gates6_status;
  125. for(new all = 0;all<MAX_PLAYERS;all++)
  126. {
  127. if(!IsPlayerConnected(all)) continue;
  128. if(IsPlayerInRangeOfPoint(all,10.0, -2695.39990234, 1270.59997559, 56.20000076))gates6_status=1;
  129. {
  130. GivePlayerMoney(playerid,-20);
  131. SendClientMessage(playerid,0xFFFAAA,"You Have paid for toll.");
  132. }
  133. }
  134. if(gates6_status)MoveObject(gates6, -2695.39990234, 1270.59997559, 46.59999847, 1.0);
  135. else MoveObject(gates6, -2695.39990234, 1270.59997559, 56.20000076, 6.5);
  136. return;
  137. }
  138.  
  139. forward Gates7Check(playerid);
  140. public Gates7Check(playerid)
  141. {
  142. new gates7_status;
  143. for(new all = 0;all<MAX_PLAYERS;all++)
  144. {
  145. if(!IsPlayerConnected(all)) continue;
  146. if(IsPlayerInRangeOfPoint(all,10.0, -1674.90002441, 548.09997559, 38.90000153))gates7_status=1;
  147. {
  148. GivePlayerMoney(playerid,-20);
  149. SendClientMessage(playerid,0xFFFAAA,"You Have paid for toll.");
  150. }
  151. }
  152. if(gates7_status)MoveObject(gates7, -1674.90002441, 548.09997559, 34.90000153, 0.5);
  153. else MoveObject(gates7, -1674.90002441, 548.09997559, 38.90000153, 6.5);
  154. return;
  155. }
  156.  
  157. forward Gates8Check(playerid);
  158. public Gates8Check(playerid)
  159. {
  160. new gates8_status;
  161. for(new all = 0;all<MAX_PLAYERS;all++)
  162. {
  163. if(!IsPlayerConnected(all)) continue;
  164. if(IsPlayerInRangeOfPoint(all,10.0, -1658.19995117, 545.09997559, 38.90000153))gates8_status=1;
  165. {
  166. GivePlayerMoney(playerid,-20);
  167. SendClientMessage(playerid,0xFFFAAA,"You Have paid for toll.");
  168. }
  169. }
  170. if(gates8_status)MoveObject(gates8, -1658.19995117, 545.09997559, 34.40000153, 0.5);
  171. else MoveObject(gates8, -1658.19995117, 545.09997559, 38.90000153, 6.5);
  172. return;
  173. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement