Advertisement
FamiliaSAMP

INCLUDE - XENON LIBRARY [FAMILIASAMP.COM]

Aug 1st, 2015
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.83 KB | None | 0 0
  1. /// INCLUDE - XENON LIBRARY
  2. /// FAMILIASAMP.COM
  3.  
  4. /*
  5. ================================
  6. Xenon Library
  7. ================================
  8. * Versão: 1.0
  9. * Creditos:
  10. * Baseado no "Xenon Extremo" de romerorodriges
  11. * Editado por King_Vegeta
  12.  
  13. * Natives:
  14. native AttachXenonToVehicle(vehicleid, XenonColor);
  15. native DestroyXenon(vehicleid);
  16. native DestroyAllXenon();
  17. */
  18. #include <a_samp>
  19. #if defined _xLibrary_included
  20. #endinput
  21. #endif
  22. #define _xLibrary_included
  23. #pragma library xLibrary
  24.  
  25. #define Azul 1
  26. #define Verde 2
  27. #define Vermelho 3
  28. #define Branco 4
  29. #define Violeta 5
  30. #define VerdeLimao 6
  31. #define Rosa 7
  32. #define Purpura 8
  33. #define Amarelo 9
  34. #define Aqua 10
  35.  
  36. new
  37. xenonazul[8][MAX_VEHICLES],
  38. xenonverde[8][MAX_VEHICLES],
  39. xenonbranco[8][MAX_VEHICLES],
  40. xenonvermelho[8][MAX_VEHICLES]
  41. ;
  42.  
  43.  
  44. stock AttachXenonToVehicle( vehicleid, XenonColor )
  45. {
  46. if(BadVehicleXenon(GetPlayerVehicleID(vehicleid)))
  47. {
  48. print("ERROR: Veiculo nao supoarta Xenon.");
  49. return 1;
  50. }
  51. DestroyXenon(vehicleid);
  52. switch(XenonColor)
  53. {
  54. case Azul:
  55. {
  56. DestroyXenon(vehicleid);
  57. AzulOne(vehicleid);
  58. AzulTwo(vehicleid);
  59. }
  60. case Verde:
  61. {
  62. DestroyXenon(vehicleid);
  63. VerdeOne(vehicleid);
  64. VerdeTwo(vehicleid);
  65. }
  66. case Vermelho:
  67. {
  68. DestroyXenon(vehicleid);
  69. VermelhoOne(vehicleid);
  70. VermelhoTwo(vehicleid);
  71. }
  72. case Branco:
  73. {
  74. DestroyXenon(vehicleid);
  75. BrancoOne(vehicleid);
  76. BrancoTwo(vehicleid);
  77. }
  78. case Violeta:
  79. {
  80. DestroyXenon(vehicleid);
  81. BrancoOne(vehicleid);
  82. BrancoTwo(vehicleid);
  83. AzulOne(vehicleid);
  84. AzulTwo(vehicleid);
  85. }
  86. case VerdeLimao:
  87. {
  88. DestroyXenon(vehicleid);
  89. BrancoOne(vehicleid);
  90. BrancoTwo(vehicleid);
  91. VerdeOne(vehicleid);
  92. VerdeTwo(vehicleid);
  93. }
  94. case Rosa:
  95. {
  96. DestroyXenon(vehicleid);
  97. BrancoOne(vehicleid);
  98. BrancoTwo(vehicleid);
  99. VermelhoOne(vehicleid);
  100. VermelhoTwo(vehicleid);
  101. }
  102. case Purpura:
  103. {
  104. DestroyXenon(vehicleid);
  105. VermelhoOne(vehicleid);
  106. VermelhoTwo(vehicleid);
  107. AzulOne(vehicleid);
  108. AzulTwo(vehicleid);
  109. }
  110. case Amarelo:
  111. {
  112. DestroyXenon(vehicleid);
  113. VermelhoOne(vehicleid);
  114. VermelhoTwo(vehicleid);
  115. VerdeOne(vehicleid);
  116. VerdeTwo(vehicleid);
  117. }
  118. case Aqua:
  119. {
  120. DestroyXenon(vehicleid);
  121. VerdeOne(vehicleid);
  122. VerdeTwo(vehicleid);
  123. AzulOne(vehicleid);
  124. AzulTwo(vehicleid);
  125. }
  126. default:
  127. {
  128. print("ERROR: Xenon Invalido.");
  129. }
  130. }
  131. return 1;
  132. }
  133.  
  134. stock BrancoOne(vehicleid)
  135. {
  136. xenonbranco[0][vehicleid] = CreateObject(19295,0,0,0,0,0,0);
  137. xenonbranco[1][vehicleid] = CreateObject(19295,0,0,0,0,0,0);
  138. xenonbranco[2][vehicleid] = CreateObject(19295,0,0,0,0,0,0);
  139. xenonbranco[3][vehicleid] = CreateObject(19295,0,0,0,0,0,0);
  140. AttachObjectToVehicle(xenonbranco[0][vehicleid], vehicleid, -1.0, 3.0, -0.8, 0.0, 0.0, 0.0);
  141. AttachObjectToVehicle(xenonbranco[1][vehicleid], vehicleid, -1.0, 5.0, -0.8, 0.0, 0.0, 0.0);
  142. AttachObjectToVehicle(xenonbranco[2][vehicleid], vehicleid, -1.0, 6.0, -0.8, 0.0, 0.0, 0.0);
  143. AttachObjectToVehicle(xenonbranco[3][vehicleid], vehicleid, -1.0, 7.0, -0.8, 0.0, 0.0, 0.0);
  144. return 1;
  145. }
  146.  
  147. stock BrancoTwo(vehicleid)
  148. {
  149. xenonbranco[4][vehicleid] = CreateObject(19295,0,0,0,0,0,0);
  150. xenonbranco[5][vehicleid] = CreateObject(19295,0,0,0,0,0,0);
  151. xenonbranco[6][vehicleid] = CreateObject(19295,0,0,0,0,0,0);
  152. xenonbranco[7][vehicleid] = CreateObject(19295,0,0,0,0,0,0);
  153. AttachObjectToVehicle(xenonbranco[4][vehicleid], vehicleid, 1.0, 3.0, -0.8, 0.0, 0.0, 0.0);
  154. AttachObjectToVehicle(xenonbranco[5][vehicleid], vehicleid, 1.0, 5.0, -0.8, 0.0, 0.0, 0.0);
  155. AttachObjectToVehicle(xenonbranco[6][vehicleid], vehicleid, 1.0, 6.0, -0.8, 0.0, 0.0, 0.0);
  156. AttachObjectToVehicle(xenonbranco[7][vehicleid], vehicleid, 1.0, 7.0, -0.8, 0.0, 0.0, 0.0);
  157. return 1;
  158. }
  159.  
  160. stock VermelhoOne(vehicleid)
  161. {
  162. xenonvermelho[0][vehicleid] = CreateObject(19296,0,0,0,0,0,0);
  163. xenonvermelho[1][vehicleid] = CreateObject(19296,0,0,0,0,0,0);
  164. xenonvermelho[2][vehicleid] = CreateObject(19296,0,0,0,0,0,0);
  165. xenonvermelho[3][vehicleid] = CreateObject(19296,0,0,0,0,0,0);
  166. AttachObjectToVehicle(xenonvermelho[0][vehicleid], vehicleid, -1.0, 3.0, -0.8, 0.0, 0.0, 0.0);
  167. AttachObjectToVehicle(xenonvermelho[1][vehicleid], vehicleid, -1.0, 5.0, -0.8, 0.0, 0.0, 0.0);
  168. AttachObjectToVehicle(xenonvermelho[2][vehicleid], vehicleid, -1.0, 6.0, -0.8, 0.0, 0.0, 0.0);
  169. AttachObjectToVehicle(xenonvermelho[3][vehicleid], vehicleid, -1.0, 7.0, -0.8, 0.0, 0.0, 0.0);
  170. return 1;
  171. }
  172.  
  173. stock VermelhoTwo(vehicleid)
  174. {
  175. xenonvermelho[4][vehicleid] = CreateObject(19296,0,0,0,0,0,0);
  176. xenonvermelho[5][vehicleid] = CreateObject(19296,0,0,0,0,0,0);
  177. xenonvermelho[6][vehicleid] = CreateObject(19296,0,0,0,0,0,0);
  178. xenonvermelho[7][vehicleid] = CreateObject(19296,0,0,0,0,0,0);
  179. AttachObjectToVehicle(xenonvermelho[4][vehicleid], vehicleid, 1.0, 3.0, -0.8, 0.0, 0.0, 0.0);
  180. AttachObjectToVehicle(xenonvermelho[5][vehicleid], vehicleid, 1.0, 5.0, -0.8, 0.0, 0.0, 0.0);
  181. AttachObjectToVehicle(xenonvermelho[6][vehicleid], vehicleid, 1.0, 6.0, -0.8, 0.0, 0.0, 0.0);
  182. AttachObjectToVehicle(xenonvermelho[7][vehicleid], vehicleid, 1.0, 7.0, -0.8, 0.0, 0.0, 0.0);
  183. return 1;
  184. }
  185.  
  186. stock VerdeOne(vehicleid)
  187. {
  188. xenonverde[0][vehicleid] = CreateObject(19297,0,0,0,0,0,0);
  189. xenonverde[1][vehicleid] = CreateObject(19297,0,0,0,0,0,0);
  190. xenonverde[2][vehicleid] = CreateObject(19297,0,0,0,0,0,0);
  191. xenonverde[3][vehicleid] = CreateObject(19297,0,0,0,0,0,0);
  192. AttachObjectToVehicle(xenonverde[0][vehicleid], vehicleid, -1.0, 3.0, -0.8, 0.0, 0.0, 0.0);
  193. AttachObjectToVehicle(xenonverde[1][vehicleid], vehicleid, -1.0, 5.0, -0.8, 0.0, 0.0, 0.0);
  194. AttachObjectToVehicle(xenonverde[2][vehicleid], vehicleid, -1.0, 6.0, -0.8, 0.0, 0.0, 0.0);
  195. AttachObjectToVehicle(xenonverde[3][vehicleid], vehicleid, -1.0, 7.0, -0.8, 0.0, 0.0, 0.0);
  196. return 1;
  197. }
  198.  
  199. stock VerdeTwo(vehicleid)
  200. {
  201. xenonverde[4][vehicleid] = CreateObject(19297,0,0,0,0,0,0);
  202. xenonverde[5][vehicleid] = CreateObject(19297,0,0,0,0,0,0);
  203. xenonverde[6][vehicleid] = CreateObject(19297,0,0,0,0,0,0);
  204. xenonverde[7][vehicleid] = CreateObject(19297,0,0,0,0,0,0);
  205. AttachObjectToVehicle(xenonverde[4][vehicleid], vehicleid, 1.0, 3.0, -0.8, 0.0, 0.0, 0.0);
  206. AttachObjectToVehicle(xenonverde[5][vehicleid], vehicleid, 1.0, 5.0, -0.8, 0.0, 0.0, 0.0);
  207. AttachObjectToVehicle(xenonverde[6][vehicleid], vehicleid, 1.0, 6.0, -0.8, 0.0, 0.0, 0.0);
  208. AttachObjectToVehicle(xenonverde[7][vehicleid], vehicleid, 1.0, 7.0, -0.8, 0.0, 0.0, 0.0);
  209. return 1;
  210. }
  211.  
  212. stock AzulOne(vehicleid)
  213. {
  214. xenonazul[0][vehicleid] = CreateObject(19298,0,0,0,0,0,0);
  215. xenonazul[1][vehicleid] = CreateObject(19298,0,0,0,0,0,0);
  216. xenonazul[2][vehicleid] = CreateObject(19298,0,0,0,0,0,0);
  217. xenonazul[3][vehicleid] = CreateObject(19295,0,0,0,0,0,0);
  218. AttachObjectToVehicle(xenonazul[0][vehicleid], vehicleid, -1.0, 3.0, -0.8, 0.0, 0.0, 0.0);
  219. AttachObjectToVehicle(xenonazul[1][vehicleid], vehicleid, -1.0, 5.0, -0.8, 0.0, 0.0, 0.0);
  220. AttachObjectToVehicle(xenonazul[2][vehicleid], vehicleid, -1.0, 6.0, -0.8, 0.0, 0.0, 0.0);
  221. AttachObjectToVehicle(xenonazul[3][vehicleid], vehicleid, -1.0, 7.0, -0.8, 0.0, 0.0, 0.0);
  222. return 1;
  223. }
  224.  
  225. stock AzulTwo(vehicleid)
  226. {
  227. xenonazul[4][vehicleid] = CreateObject(19295,0,0,0,0,0,0);
  228. xenonazul[5][vehicleid] = CreateObject(19298,0,0,0,0,0,0);
  229. xenonazul[6][vehicleid] = CreateObject(19298,0,0,0,0,0,0);
  230. xenonazul[7][vehicleid] = CreateObject(19295,0,0,0,0,0,0);
  231. AttachObjectToVehicle(xenonazul[4][vehicleid], vehicleid, 1.0, 3.0, -0.8, 0.0, 0.0, 0.0);
  232. AttachObjectToVehicle(xenonazul[5][vehicleid], vehicleid, 1.0, 5.0, -0.8, 0.0, 0.0, 0.0);
  233. AttachObjectToVehicle(xenonazul[6][vehicleid], vehicleid, 1.0, 6.0, -0.8, 0.0, 0.0, 0.0);
  234. AttachObjectToVehicle(xenonazul[7][vehicleid], vehicleid, 1.0, 7.0, -0.8, 0.0, 0.0, 0.0);
  235. return 1;
  236. }
  237.  
  238. stock DestroyXenon(vehicleid)
  239. {
  240. for(new x; x < sizeof(xenonazul); x++)
  241. {
  242. DestroyObject(xenonazul[x][vehicleid]);
  243. }
  244. for(new x; x < sizeof(xenonverde); x++)
  245. {
  246. DestroyObject(xenonverde[x][vehicleid]);
  247. }
  248. for(new x; x < sizeof(xenonvermelho); x++)
  249. {
  250. DestroyObject(xenonvermelho[x][vehicleid]);
  251. }
  252. for(new x; x < sizeof(xenonbranco); x++)
  253. {
  254. DestroyObject(xenonbranco[x][vehicleid]);
  255. }
  256. return 1;
  257. }
  258.  
  259. stock BadVehicleXenon( vehicleid )
  260. {
  261. new result;
  262. new model = GetVehicleModel( vehicleid );
  263. switch( model )
  264. {
  265. case 522,462,521,461,463,581,448,586,
  266. 523,468,471,509,481,510,539,472,473,
  267. 493,595,484,430,453,452,446,454,548,
  268. 425,417,487,497,563,501,465,447,469,
  269. 488,520,476,593,553,513,512,577,592,
  270. 511,464,519,460: result = model;
  271. default: result = 0;
  272. }
  273. return result;
  274. }
  275.  
  276. stock DestroyAllXenon()
  277. {
  278. for(new i = 0; i < MAX_VEHICLES; i++)
  279. {
  280. for(new x; x < sizeof(xenonazul); x++)
  281. {
  282. DestroyObject(xenonazul[x][i]);
  283. }
  284. for(new x; x < sizeof(xenonverde); x++)
  285. {
  286. DestroyObject(xenonverde[x][i]);
  287. }
  288. for(new x; x < sizeof(xenonvermelho); x++)
  289. {
  290. DestroyObject(xenonvermelho[x][i]);
  291. }
  292. for(new x; x < sizeof(xenonbranco); x++)
  293. {
  294. DestroyObject(xenonbranco[x][i]);
  295. }
  296. }
  297. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement