Advertisement
Guest User

NeRoSiS

a guest
Mar 7th, 2009
1,549
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.23 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. // This is a comment
  4. // uncomment the line below if you want to write a filterscript
  5.  
  6. /*CreateObject(971, 2644.538086, -2039.156250, 12.855463, 0.0000, 0.0000, 0.0000);
  7. CreateObject(971, 1042.446411, -1026.004761, 31.101563, 0.0000, 0.0000, 0.0000);
  8. CreateObject(971, -2716.016113, 217.545639, 3.295407, 0.0000, 0.0000, 269.7591);*/
  9. #define FILTERSCRIPT
  10.  
  11. #if defined FILTERSCRIPT
  12.  
  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 BLUE 0x1229FAFF
  22. #define LIGHTGREEN 0x38FF06FF
  23. #define DARKPINK 0xE100E1FF
  24. #define DARKGREEN 0x008040FF
  25. #define AQUAGREEN 0x00CACAFB
  26. #define NICESKY 0x99FFFFAA
  27. #define GREY 0xCECECEFF
  28. #define WHITE 0xFFFFFFFF
  29.  
  30. new Float:q, Float:w, Float:e;
  31. new tune1;
  32. new tune2;
  33.  
  34. forward tunea(playerid);
  35. forward tuneb(playerid);
  36.  
  37.  
  38.  
  39. public OnFilterScriptInit()
  40. {
  41. print("\n--------------------------------------");
  42. print(" Blank Filterscript by your name here");
  43. print("--------------------------------------\n");
  44.  
  45.  
  46. CreateObject(971, 2644.538086, -2039.156250, 12.855463, 0.0000, 0.0000, 0.0000);
  47. CreateObject(971, 1042.446411, -1026.004761, 31.101563, 0.0000, 0.0000, 0.0000);
  48. CreateObject(971, -2716.016113, 217.545639, 3.295407, 0.0000, 0.0000, 269.7591);
  49.  
  50. return 1;
  51. }
  52.  
  53. public OnFilterScriptExit()
  54. {
  55. return 1;
  56. }
  57.  
  58.  
  59. public OnPlayerCommandText(playerid, cmdtext[])
  60. {
  61. if(strcmp(cmdtext,"/tune", true) == 0)
  62. {
  63. new vehicleid = GetPlayerVehicleID(playerid);
  64. if(!IsPlayerInTransfenderVehicle(playerid, vehicleid))
  65. {
  66. GetPlayerPos(playerid, q, w, e);
  67. SetPlayerVirtualWorld(playerid,playerid+1);
  68. SetVehiclePos(vehicleid,1041.1611,-1020.1884,31.9751);
  69. SetVehicleZAngle(vehicleid, 359.6632);
  70. SetVehicleVirtualWorld(vehicleid, playerid+1);
  71. tune1 = SetTimer("tunea",1000,true);
  72. SendClientMessage(playerid, PURPLE, "When you are finished modifying your car please exit the garage");
  73. }
  74. else if(!IsPlayerInLocolowVehicle(playerid, vehicleid))
  75. {
  76. GetPlayerPos(playerid, q, w, e);
  77. SetPlayerVirtualWorld(playerid,playerid+1);
  78. SetVehiclePos(vehicleid,2644.7661,-2042.4143,13.2611);
  79. SetVehicleZAngle(vehicleid, 178.4298);
  80. SetVehicleVirtualWorld(vehicleid, playerid+1);
  81. tune1 = SetTimer("tunea",1000,true);
  82. SendClientMessage(playerid, PURPLE, "When you are finished modifying your car please exit the garage");
  83. }
  84. else if(!IsPlayerInWAAVehicle(playerid, vehicleid))
  85. {
  86. GetPlayerPos(playerid, q, w, e);
  87. SetPlayerVirtualWorld(playerid,playerid+1);
  88. SetVehiclePos(vehicleid,-2721.9834,217.1915,4.3515);
  89. SetVehicleZAngle(vehicleid, 92.3493);
  90. SetVehicleVirtualWorld(vehicleid, playerid+1);
  91. tune1 = SetTimer("tunea",1000,true);
  92. SendClientMessage(playerid, PURPLE, "When you are finished modifying your car please exit the garage");
  93.  
  94. }
  95. else
  96. {
  97. SendClientMessage(playerid, RED, "You are either not in a vehicle or not in a vehicle that can be modded");
  98. }
  99. return 1;
  100. }
  101. return 0;
  102. }
  103.  
  104.  
  105. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  106. {
  107.  
  108. if(!IsPlayerInTransfenderVehicle(playerid, vehicleid))
  109. {
  110. SendClientMessage(playerid, PURPLE, "Type /tune to mod your vehicle, when finished you will be brought back to your location!");
  111. }
  112. else if(!IsPlayerInLocolowVehicle(playerid, vehicleid))
  113. {
  114. SendClientMessage(playerid, PURPLE, "Type /tune to mod your vehicle, when finished you will be brought back to your location!");
  115. }
  116. else if(!IsPlayerInWAAVehicle(playerid, vehicleid))
  117. {
  118. SendClientMessage(playerid, PURPLE, "Type /tune to mod your vehicle, when finished you will be brought back to your location!");
  119. }
  120. return 1;
  121. }
  122.  
  123.  
  124. IsPlayerInTransfenderVehicle(playerid,vehicleid)
  125. {
  126. #define MAX_VALID_TRANSFENDER_VEHICLES 65
  127.  
  128. new InTransfenderVehicle[MAX_VALID_TRANSFENDER_VEHICLES] =
  129. {
  130. 400,401,402,404,405,409,410,411,415,418,419,420,421,422,424,426,436,438,439,
  131. 442,445,451,458,466,467,474,475,477,478,479,480,489,491,492,496,500,505,506,
  132. 507,516,517,518,527,526,529,533,540,541,542,545,546,547,549,550,551,555,575,
  133. 579,580,585,587,589,600,602,603
  134.  
  135. };
  136.  
  137. vehicleid = GetPlayerVehicleID(playerid);
  138.  
  139. if(IsPlayerInVehicle(playerid,vehicleid))
  140. {
  141. for(new i = 0; i < MAX_VALID_TRANSFENDER_VEHICLES; i++)
  142. {
  143. if(GetVehicleModel(vehicleid) == InTransfenderVehicle[i])
  144. {
  145. return 0;
  146. }
  147. }
  148. }
  149. return 1;
  150. }
  151.  
  152. IsPlayerInLocolowVehicle(playerid,vehicleid)
  153. {
  154. #define MAX_VALID_LOCOLOW_VEHICLES 7
  155.  
  156. new InLocolowVehicle[MAX_VALID_LOCOLOW_VEHICLES] =
  157. {
  158. 412,534,535,536,566,567,576
  159. };
  160.  
  161. vehicleid = GetPlayerVehicleID(playerid);
  162.  
  163. if(IsPlayerInVehicle(playerid,vehicleid))
  164. {
  165. for(new i = 0; i < MAX_VALID_LOCOLOW_VEHICLES; i++)
  166. {
  167. if(GetVehicleModel(vehicleid) == InLocolowVehicle[i])
  168. {
  169. return 0;
  170. }
  171. }
  172. }
  173. return 1;
  174. }
  175.  
  176. IsPlayerInWAAVehicle(playerid,vehicleid)
  177. {
  178. #define MAX_VALID_WAA_VEHICLES 6
  179.  
  180. new InWAAVehicle[MAX_VALID_WAA_VEHICLES] =
  181. {
  182. 558,559,560,561,562,565
  183. };
  184.  
  185. vehicleid = GetPlayerVehicleID(playerid);
  186.  
  187. if(IsPlayerInVehicle(playerid,vehicleid))
  188. {
  189. for(new i = 0; i < MAX_VALID_WAA_VEHICLES; i++)
  190. {
  191. if(GetVehicleModel(vehicleid) == InWAAVehicle[i])
  192. {
  193. return 0;
  194. }
  195. }
  196. }
  197. return 1;
  198. }
  199.  
  200. public tunea(playerid)
  201. {
  202. if (PlayerToPoint(20, playerid,617.5380,-1.9900,1000.6829))
  203. {
  204. tune2 = SetTimer("tuneb",1000,true);
  205. }
  206. else if (PlayerToPoint(20, playerid,616.7820,-74.8151,997.6350))
  207. {
  208. tune2 = SetTimer("tuneb",1000,true);
  209. }
  210. else if (PlayerToPoint(20, playerid,615.2851,-124.2390,997.6350))
  211. {
  212. tune2 = SetTimer("tuneb",1000,true);
  213. }
  214. return 1;
  215. }
  216.  
  217. public tuneb(playerid)
  218. {
  219. KillTimer(tune1);
  220. new vehicleid = GetPlayerVehicleID(playerid);
  221. if (PlayerToPoint(20, playerid,1041.1611,-1020.1884,31.9751))
  222. {
  223. KillTimer(tune1);
  224. SetVehiclePos(vehicleid, q, w, e);
  225. SetPlayerVirtualWorld(playerid,0);
  226. SetVehicleVirtualWorld(vehicleid, 0);
  227. KillTimer(tune2);
  228. }
  229. else if (PlayerToPoint(20, playerid,-2721.9834,217.1915,4.3515))
  230. {
  231. KillTimer(tune1);
  232. SetVehiclePos(vehicleid, q, w, e);
  233. SetPlayerVirtualWorld(playerid,0);
  234. SetVehicleVirtualWorld(vehicleid, 0);
  235. KillTimer(tune2);
  236. }
  237. else if (PlayerToPoint(20, playerid,2644.7661,-2042.4143,13.2611))
  238. {
  239. KillTimer(tune1);
  240. SetVehiclePos(vehicleid, q, w, e);
  241. SetPlayerVirtualWorld(playerid,0);
  242. SetVehicleVirtualWorld(vehicleid, 0); //KillTimer()
  243. KillTimer(tune2);
  244. }
  245. return 1;
  246. }
  247.  
  248.  
  249. PlayerToPoint(Float:radius, playerid, Float:X, Float:Y, Float:Z)
  250. {
  251. new Float:oldpos[3], Float:temppos[3];
  252. GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
  253. temppos[0] = (oldpos[0] -X);
  254. temppos[1] = (oldpos[1] -Y);
  255. temppos[2] = (oldpos[2] -Z);
  256. if(((temppos[0] < radius) && (temppos[0] > -radius)) && ((temppos[1] < radius) && (temppos[1] > -radius)) && ((temppos[2] < radius) && (temppos[2] > -radius)))
  257. {
  258. return true;
  259. }
  260. return false;
  261. }
  262. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement