EVF2.inc 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948
  1. /*
  2. Extended vehicle functions by Emmet_
  3. Thanks to:
  4. - [uL]Pottus -> GetVehicleTopSpeed idea
  5. - kvann -> SetVehicleInterior idea
  6. - Hanger -> Top speed data
  7. */
  8. #if !defined INVALID_SEAT_ID
  9. #define INVALID_SEAT_ID -1
  10. #endif
  11. #if !defined INVALID_PAINTJOB_ID
  12. #define INVALID_PAINTJOB_ID -1
  13. #endif
  14. #define GetVehicleSeats(%0) \
  15. (GetVehicleModelSeats(GetVehicleModel(%0)))
  16. #define SetVehicleInterior(%0) \
  17. (LinkVehicleToInterior(%0))
  18. #define GetVehicleBoot(%0,%1,%2,%3) \
  19. (GetVehicleOffset((%0), VEHICLE_OFFSET_BOOT, %1, %2, %3))
  20. #define GetVehicleHood(%0,%1,%2,%3) \
  21. (GetVehicleOffset((%0), VEHICLE_OFFSET_HOOD, %1, %2, %3))
  22. #define GetVehicleRoof(%0,%1,%2,%3) \
  23. (GetVehicleOffset((%0), VEHICLE_OFFSET_ROOF, %1, %2, %3))
  24. enum e_VehicleProperties {
  25. e_VEHICLE_INTERIOR,
  26. e_VEHICLE_PAINTJOB,
  27. e_VEHICLE_COLOR_1,
  28. e_VEHICLE_COLOR_2
  29. };
  30. static s_VehicleTrailerID[MAX_VEHICLES];
  31. // Called when a vehicle is created.
  32. forward OnVehicleCreated(vehicleid);
  33. // Called when a vehicle is deleted.
  34. forward OnVehicleDestroyed(vehicleid);
  35. // Called when a trailer is hooked.
  36. forward OnTrailerHooked(playerid, vehicleid, trailerid);
  37. // Called when a trailer is unhooked.
  38. forward OnTrailerUnhooked(playerid, vehicleid, trailerid);
  39. // Called when a player shoots at a vehicle.
  40. forward OnPlayerShootVehicle(playerid, vehicleid, weaponid);
  41. enum e_ParamTypes {
  42. VEHICLE_TYPE_ENGINE,
  43. VEHICLE_TYPE_LIGHTS,
  44. VEHICLE_TYPE_ALARM,
  45. VEHICLE_TYPE_DOORS,
  46. VEHICLE_TYPE_BONNET,
  47. VEHICLE_TYPE_BOOT,
  48. VEHICLE_TYPE_OBJECTIVE
  49. };
  50. enum e_OffsetTypes {
  51. VEHICLE_OFFSET_BOOT,
  52. VEHICLE_OFFSET_HOOD,
  53. VEHICLE_OFFSET_ROOF
  54. };
  55. #if !defined IsValidVehicle
  56. native IsValidVehicle(vehicleid);
  57. #endif
  58. static const s_TopSpeed[212] = {
  59. 157, 147, 186, 110, 133, 164, 110, 148, 100, 158, 129, 221, 168, 110, 105, 192, 154, 270,
  60. 115, 149, 145, 154, 140, 99, 135, 270, 173, 165, 157, 201, 190, 130, 94, 110, 167, 0, 149,
  61. 158, 142, 168, 136, 145, 139, 126, 110, 164, 270, 270, 111, 0, 0, 193, 270, 60, 135, 157,
  62. 106, 95, 157, 136, 270, 160, 111, 142, 145, 145, 147, 140, 144, 270, 157, 110, 190, 190,
  63. 149, 173, 270, 186, 117, 140, 184, 73, 156, 122, 190, 99, 64, 270, 270, 139, 157, 149, 140,
  64. 270, 214, 176, 162, 270, 108, 123, 140, 145, 216, 216, 173, 140, 179, 166, 108, 79, 101, 270,
  65. 270, 270, 120, 142, 157, 157, 164, 270, 270, 160, 176, 151, 130, 160, 158, 149, 176, 149, 60,
  66. 70, 110, 167, 168, 158, 173, 0, 0, 270, 149, 203, 164, 151, 150, 147, 149, 142, 270, 153, 145,
  67. 157, 121, 270, 144, 158, 113, 113, 156, 178, 169, 154, 178, 270, 145, 165, 160, 173, 146, 0, 0,
  68. 93, 60, 110, 60, 158, 158, 270, 130, 158, 153, 151, 136, 85, 0, 153, 142, 165, 108, 162, 0, 0,
  69. 270, 270, 130, 190, 175, 175, 175, 158, 151, 110, 169, 171, 148, 152, 0, 0, 0, 108, 0, 0
  70. };
  71. static const s_CarColors[][] = {
  72. {16, 004, 001, 123, 001, 113, 001, 101, 001, 075, 001, 062, 001, 040, 001, 036, 001},
  73. {16, 041, 041, 047, 047, 052, 052, 066, 066, 074, 074, 087, 087, 091, 091, 113, 113},
  74. {16, 010, 010, 013, 013, 022, 022, 030, 030, 039, 039, 090, 090, 098, 098, 110, 110},
  75. {16, 036, 001, 037, 001, 030, 001, 028, 001, 025, 001, 040, 001, 101, 001, 113, 001},
  76. {16, 113, 039, 119, 050, 123, 092, 109, 100, 101, 101, 095, 105, 083, 110, 066, 025},
  77. {16, 011, 001, 024, 001, 036, 001, 040, 001, 075, 001, 091, 001, 123, 001, 004, 001},
  78. {2, 001, 001},
  79. {2, 003, 001},
  80. {2, 026, 026},
  81. {2, 001, 001},
  82. {16, 004, 001, 009, 001, 010, 001, 025, 001, 036, 001, 040, 001, 045, 001, 084, 001},
  83. {16, 012, 001, 064, 001, 123, 001, 116, 001, 112, 001, 106, 001, 080, 001, 075, 001},
  84. {16, 009, 001, 010, 008, 011, 001, 025, 008, 027, 001, 029, 008, 030, 001, 037, 008},
  85. {16, 087, 001, 088, 001, 091, 001, 105, 001, 109, 001, 119, 001, 004, 001, 025, 001},
  86. {16, 025, 001, 028, 001, 043, 001, 067, 001, 072, 001, 009, 001, 095, 001, 024, 001},
  87. {16, 020, 001, 025, 001, 036, 001, 040, 001, 062, 001, 075, 001, 092, 001, 000, 001},
  88. {2, 001, 003},
  89. {0, 000, 000},
  90. {16, 119, 119, 117, 227, 114, 114, 108, 108, 095, 095, 081, 081, 061, 061, 041, 041},
  91. {16, 045, 075, 047, 076, 033, 075, 013, 076, 054, 075, 069, 076, 059, 075, 087, 076},
  92. {2, 006, 001},
  93. {16, 004, 001, 013, 001, 025, 001, 030, 001, 036, 001, 040, 001, 075, 001, 095, 001},
  94. {14, 096, 025, 097, 025, 101, 025, 111, 031, 113, 036, 083, 057, 067, 059},
  95. {12, 001, 016, 001, 056, 001, 017, 001, 053, 001, 005, 001, 035},
  96. {16, 001, 000, 002, 002, 003, 002, 003, 006, 006, 016, 015, 030, 024, 053, 035, 061},
  97. {2, 043, 000},
  98. {16, 037, 037, 042, 042, 053, 053, 062, 062, 007, 007, 010, 010, 011, 011, 015, 015},
  99. {2, 000, 001},
  100. {2, 004, 075},
  101. {16, 012, 012, 013, 013, 014, 014, 001, 002, 002, 001, 001, 003, 003, 001, 010, 010},
  102. {2, 046, 026},
  103. {16, 071, 059, 075, 059, 092, 072, 047, 074, 055, 083, 059, 083, 071, 087, 082, 087},
  104. {2, 043, 000},
  105. {2, 043, 000},
  106. {14, 001, 001, 012, 012, 002, 002, 006, 006, 004, 004, 046, 046, 053, 053},
  107. {2, 001, 001},
  108. {14, 083, 001, 087, 001, 092, 001, 095, 001, 109, 001, 119, 045, 011, 001},
  109. {16, 054, 007, 079, 007, 087, 007, 095, 016, 098, 020, 105, 020, 123, 020, 125, 021},
  110. {2, 006, 076},
  111. {16, 057, 008, 008, 017, 043, 021, 054, 038, 067, 008, 037, 078, 065, 079, 025, 078},
  112. {16, 034, 034, 032, 032, 020, 020, 110, 110, 066, 066, 084, 084, 118, 118, 121, 121},
  113. {16, 002, 096, 079, 042, 082, 054, 067, 086, 126, 096, 070, 096, 110, 054, 067, 098},
  114. {16, 000, 000, 011, 105, 025, 109, 036, 000, 040, 036, 075, 036, 000, 036, 000, 109},
  115. {16, 004, 001, 020, 001, 024, 001, 025, 001, 036, 001, 040, 001, 054, 001, 084, 001},
  116. {12, 032, 036, 032, 042, 032, 053, 032, 066, 032, 014, 032, 032},
  117. {16, 034, 034, 035, 035, 037, 037, 039, 039, 041, 041, 043, 043, 045, 045, 047, 047},
  118. {32, 000, 000, 000, 001, 001, 005, 001, 001, 003, 003, 000, 001, 001, 022, 001, 001, 001, 035, 001, 001, 001, 044, 001, 001, 001, 053, 001, 001, 001, 057, 001, 001},
  119. {2, 075, 002},
  120. {2, 001, 003},
  121. {2, 001, 074},
  122. {2, 001, 001},
  123. {16, 123, 123, 125, 125, 036, 036, 016, 016, 018, 018, 046, 046, 061, 061, 075, 075},
  124. {16, 001, 003, 001, 005, 001, 016, 001, 022, 001, 035, 001, 044, 001, 053, 001, 057},
  125. {2, 056, 056},
  126. {2, 026, 026},
  127. {16, 084, 015, 084, 058, 084, 031, 032, 074, 043, 031, 001, 031, 077, 031, 032, 074},
  128. {16, 084, 063, 091, 063, 102, 065, 105, 072, 110, 093, 121, 093, 012, 095, 023, 001},
  129. {16, 058, 001, 002, 001, 063, 001, 018, 001, 032, 001, 045, 001, 013, 001, 034, 001},
  130. {16, 091, 001, 101, 001, 109, 001, 113, 001, 004, 001, 025, 001, 030, 001, 036, 001},
  131. {16, 026, 026, 028, 028, 044, 044, 051, 051, 057, 057, 072, 072, 106, 106, 112, 112},
  132. {16, 001, 003, 001, 009, 001, 018, 001, 030, 017, 023, 046, 023, 046, 032, 057, 034},
  133. {16, 036, 001, 037, 001, 043, 001, 053, 001, 061, 001, 075, 001, 079, 001, 088, 001},
  134. {16, 012, 012, 013, 013, 014, 014, 001, 002, 002, 001, 001, 003, 003, 001, 010, 010},
  135. {16, 079, 079, 084, 084, 007, 007, 011, 011, 019, 019, 022, 022, 036, 036, 053, 053},
  136. {2, 014, 075},
  137. {2, 014, 075},
  138. {16, 067, 076, 068, 076, 078, 076, 002, 076, 016, 076, 018, 076, 025, 076, 045, 088},
  139. {16, 051, 001, 058, 008, 060, 001, 068, 008, 002, 001, 013, 008, 022, 001, 036, 008},
  140. {8, 006, 006, 046, 046, 053, 053, 003, 003},
  141. {0, 000, 000},
  142. {2, 043, 000},
  143. {16, 120, 117, 103, 111, 120, 114, 074, 091, 120, 112, 074, 083, 120, 113, 066, 071},
  144. {4, 056, 015, 056, 053},
  145. {4, 056, 015, 056, 053},
  146. {16, 097, 001, 081, 001, 105, 001, 110, 001, 091, 001, 074, 001, 084, 001, 083, 001},
  147. {16, 002, 039, 009, 039, 017, 001, 021, 001, 033, 000, 037, 000, 041, 029, 056, 029},
  148. {16, 006, 007, 007, 006, 001, 006, 089, 091, 119, 117, 103, 102, 077, 087, 071, 077},
  149. {16, 092, 001, 094, 001, 101, 001, 121, 001, 000, 001, 022, 001, 036, 001, 075, 001},
  150. {16, 072, 001, 066, 001, 059, 001, 045, 001, 040, 001, 039, 001, 035, 001, 020, 001},
  151. {16, 027, 036, 059, 036, 060, 035, 055, 041, 054, 031, 049, 023, 045, 032, 040, 029},
  152. {14, 073, 045, 012, 012, 002, 002, 006, 006, 004, 004, 046, 046, 053, 053},
  153. {16, 001, 001, 003, 003, 006, 006, 046, 046, 065, 009, 014, 001, 012, 009, 026, 001},
  154. {16, 041, 041, 048, 048, 052, 052, 064, 064, 071, 071, 085, 085, 010, 010, 062, 062},
  155. {32, 001, 031, 001, 000, 001, 031, 001, 000, 001, 020, 003, 000, 001, 005, 000, 000, 000, 006, 003, 000, 003, 006, 003, 000, 016, 000, 008, 000, 017, 000, 120, 000},
  156. {8, 012, 035, 050, 032, 040, 026, 066, 036},
  157. {14, 001, 073, 001, 074, 001, 075, 001, 076, 001, 077, 001, 078, 001, 079},
  158. {2, 001, 001},
  159. {16, 026, 014, 029, 042, 026, 057, 054, 029, 026, 003, 003, 029, 012, 039, 074, 035},
  160. {4, 002, 026, 002, 029},
  161. {12, 013, 118, 014, 123, 120, 123, 112, 120, 084, 110, 076, 102},
  162. {2, 000, 000},
  163. {12, 040, 065, 071, 072, 052, 066, 064, 072, 030, 072, 060, 072},
  164. {16, 030, 026, 077, 026, 081, 027, 024, 055, 028, 056, 049, 059, 052, 069, 071, 107},
  165. {2, 036, 013},
  166. {16, 007, 094, 036, 088, 051, 075, 053, 075, 058, 067, 075, 067, 075, 061, 079, 062},
  167. {16, 123, 124, 119, 122, 118, 117, 116, 115, 114, 108, 101, 106, 088, 099, 005, 006},
  168. {16, 074, 072, 066, 072, 053, 056, 037, 019, 022, 022, 020, 020, 009, 014, 000, 000},
  169. {2, 000, 001},
  170. {16, 011, 123, 013, 120, 020, 117, 024, 112, 027, 107, 036, 105, 037, 107, 043, 093},
  171. {16, 109, 025, 109, 032, 112, 032, 010, 032, 030, 044, 032, 052, 084, 066, 084, 069},
  172. {16, 075, 084, 040, 084, 040, 110, 028, 119, 025, 119, 021, 119, 013, 119, 004, 119},
  173. {2, 014, 075},
  174. {16, 083, 066, 087, 074, 087, 075, 098, 083, 101, 100, 103, 101, 117, 116, 123, 036},
  175. {16, 036, 117, 036, 013, 042, 030, 042, 033, 054, 036, 075, 079, 092, 101, 098, 109},
  176. {16, 051, 039, 057, 038, 045, 029, 034, 009, 065, 009, 014, 001, 012, 009, 026, 001},
  177. {12, 013, 118, 014, 123, 120, 123, 112, 120, 084, 110, 076, 102},
  178. {10, 003, 003, 006, 006, 007, 007, 052, 052, 076, 076},
  179. {16, 037, 037, 042, 042, 053, 053, 062, 062, 007, 007, 010, 010, 011, 011, 015, 015},
  180. {2, 001, 001},
  181. {16, 007, 001, 074, 001, 061, 001, 016, 001, 025, 001, 030, 001, 036, 001, 053, 001},
  182. {16, 043, 043, 046, 046, 039, 039, 028, 028, 016, 016, 006, 006, 005, 005, 002, 002},
  183. {16, 003, 090, 004, 090, 007, 068, 008, 066, 012, 060, 027, 097, 034, 051, 037, 051},
  184. {16, 017, 039, 015, 123, 032, 112, 045, 088, 052, 071, 057, 067, 061, 096, 096, 096},
  185. {16, 038, 051, 021, 036, 021, 034, 030, 034, 054, 034, 055, 020, 048, 018, 051, 006},
  186. {16, 010, 001, 025, 001, 028, 001, 036, 001, 040, 001, 054, 001, 075, 001, 113, 001},
  187. {16, 013, 076, 024, 077, 063, 078, 042, 076, 054, 077, 039, 078, 011, 076, 062, 077},
  188. {16, 116, 001, 119, 001, 122, 001, 004, 001, 009, 001, 024, 001, 027, 001, 036, 001},
  189. {16, 037, 036, 036, 036, 040, 036, 043, 041, 047, 041, 051, 072, 054, 075, 055, 084},
  190. {16, 002, 039, 009, 039, 017, 001, 021, 001, 033, 000, 037, 000, 041, 029, 056, 029},
  191. {2, 001, 001},
  192. {0, 000, 000},
  193. {16, 074, 074, 075, 013, 087, 118, 092, 003, 115, 118, 025, 118, 036, 000, 118, 118},
  194. {16, 003, 003, 003, 008, 006, 025, 007, 079, 008, 082, 036, 105, 039, 106, 051, 118},
  195. {0, 000, 000},
  196. {32, 060, 024, 023, 000, 061, 027, 123, 000, 065, 031, 031, 000, 061, 061, 030, 000, 081, 035, 023, 000, 062, 061, 062, 000, 083, 066, 064, 000, 083, 064, 064, 000},
  197. {14, 001, 001, 017, 020, 018, 020, 022, 030, 036, 043, 044, 051, 052, 054},
  198. {16, 002, 039, 009, 039, 017, 001, 021, 001, 033, 000, 037, 000, 041, 029, 056, 029},
  199. {16, 052, 001, 053, 001, 066, 001, 075, 001, 076, 001, 081, 001, 095, 001, 109, 001},
  200. {0, 000, 000},
  201. {16, 037, 037, 042, 042, 053, 053, 062, 062, 007, 007, 010, 010, 011, 011, 015, 015},
  202. {16, 110, 001, 111, 001, 112, 001, 114, 001, 119, 001, 122, 001, 004, 001, 013, 001},
  203. {12, 002, 035, 036, 002, 051, 053, 091, 002, 011, 022, 040, 035},
  204. {0, 000, 000},
  205. {16, 073, 001, 074, 001, 075, 001, 077, 001, 079, 001, 083, 001, 084, 001, 091, 001},
  206. {16, 037, 037, 042, 042, 053, 053, 062, 062, 007, 007, 010, 010, 011, 011, 015, 015},
  207. {16, 003, 001, 028, 001, 031, 001, 055, 001, 066, 001, 097, 001, 123, 001, 118, 001},
  208. {16, 009, 001, 012, 001, 026, 096, 030, 096, 032, 001, 037, 001, 057, 096, 071, 096},
  209. {2, 001, 001},
  210. {2, 001, 001},
  211. {14, 096, 067, 086, 070, 079, 074, 070, 086, 061, 098, 075, 075, 075, 091},
  212. {16, 037, 037, 042, 042, 053, 053, 062, 062, 007, 007, 010, 010, 011, 011, 015, 015},
  213. {16, 051, 001, 058, 008, 060, 001, 068, 008, 002, 001, 013, 008, 022, 001, 036, 008},
  214. {16, 013, 118, 024, 118, 031, 093, 032, 092, 045, 092, 113, 092, 119, 113, 122, 113},
  215. {16, 076, 008, 032, 008, 043, 008, 067, 008, 011, 011, 008, 090, 002, 002, 083, 013},
  216. {2, 003, 001},
  217. {16, 050, 001, 047, 001, 044, 096, 040, 096, 039, 001, 030, 001, 028, 096, 009, 096},
  218. {16, 062, 037, 078, 038, 002, 062, 003, 087, 002, 078, 113, 078, 119, 062, 007, 078},
  219. {16, 122, 001, 123, 001, 125, 001, 010, 001, 024, 001, 037, 001, 055, 001, 066, 001},
  220. {2, 001, 001},
  221. {16, 074, 039, 072, 039, 075, 039, 079, 039, 083, 036, 084, 036, 089, 035, 091, 035},
  222. {16, 037, 037, 042, 042, 053, 053, 062, 062, 007, 007, 010, 010, 011, 011, 015, 015},
  223. {16, 067, 001, 072, 001, 075, 001, 083, 001, 091, 001, 101, 001, 109, 001, 020, 001},
  224. {6, 056, 056, 049, 049, 026, 124},
  225. {16, 038, 009, 055, 023, 061, 074, 071, 087, 091, 087, 098, 114, 102, 119, 111, 003},
  226. {16, 053, 032, 015, 032, 045, 032, 034, 030, 065, 032, 014, 032, 012, 032, 043, 032},
  227. {16, 051, 001, 058, 001, 060, 001, 068, 001, 002, 001, 013, 001, 022, 001, 036, 001},
  228. {2, 001, 001},
  229. {2, 001, 001},
  230. {16, 112, 001, 116, 001, 117, 001, 024, 001, 030, 001, 035, 001, 036, 001, 040, 001},
  231. {16, 051, 001, 058, 008, 060, 001, 068, 008, 002, 001, 013, 008, 022, 001, 036, 008},
  232. {16, 052, 039, 009, 039, 017, 001, 021, 001, 033, 000, 037, 000, 041, 029, 056, 029},
  233. {16, 057, 008, 008, 017, 043, 021, 054, 038, 067, 008, 037, 078, 065, 079, 025, 078},
  234. {16, 036, 001, 035, 001, 017, 001, 011, 001, 116, 001, 113, 001, 101, 001, 092, 001},
  235. {2, 001, 006},
  236. {0, 000, 000},
  237. {16, 037, 037, 042, 042, 053, 053, 062, 062, 007, 007, 010, 010, 011, 011, 015, 015},
  238. {16, 109, 001, 030, 008, 095, 001, 084, 008, 083, 001, 072, 008, 071, 001, 052, 008},
  239. {16, 097, 096, 088, 064, 090, 096, 093, 064, 097, 096, 099, 081, 102, 114, 114, 001},
  240. {16, 002, 039, 009, 039, 017, 001, 021, 001, 033, 000, 037, 000, 041, 029, 056, 029},
  241. {0, 000, 000},
  242. {2, 001, 001},
  243. {12, 002, 035, 036, 002, 051, 053, 091, 002, 011, 022, 040, 035},
  244. {16, 094, 001, 101, 001, 116, 001, 117, 001, 004, 001, 025, 001, 030, 001, 037, 001},
  245. {16, 091, 038, 115, 043, 085, 006, 079, 007, 078, 008, 077, 018, 079, 018, 086, 024},
  246. {2, 026, 026},
  247. {16, 012, 001, 019, 096, 031, 064, 025, 096, 038, 001, 051, 096, 057, 001, 066, 096},
  248. {16, 067, 001, 068, 096, 072, 001, 074, 008, 075, 096, 076, 008, 079, 001, 084, 096},
  249. {12, 001, 003, 008, 007, 008, 010, 008, 016, 023, 031, 040, 044},
  250. {2, 001, 001},
  251. {16, 037, 037, 042, 042, 053, 053, 062, 062, 007, 007, 010, 010, 011, 011, 015, 015},
  252. {18, 092, 092, 081, 081, 067, 067, 066, 066, 061, 061, 053, 053, 051, 051, 047, 047, 043, 043},
  253. {16, 054, 001, 058, 001, 066, 001, 072, 001, 075, 001, 087, 001, 101, 001, 036, 001},
  254. {16, 041, 010, 041, 020, 049, 011, 056, 123, 110, 113, 112, 116, 114, 118, 119, 101},
  255. {2, 001, 001},
  256. {2, 001, 001},
  257. {16, 037, 037, 042, 042, 053, 053, 062, 062, 007, 007, 010, 010, 011, 011, 015, 015},
  258. {16, 119, 001, 122, 001, 008, 001, 010, 001, 013, 001, 025, 001, 027, 001, 032, 001},
  259. {16, 036, 001, 040, 001, 043, 001, 053, 001, 072, 001, 075, 001, 095, 001, 101, 001},
  260. {2, 001, 001},
  261. {16, 037, 037, 031, 031, 023, 023, 022, 022, 007, 007, 124, 124, 114, 114, 112, 112},
  262. {0, 000, 000},
  263. {2, 001, 001},
  264. {2, 001, 001},
  265. {16, 051, 001, 058, 008, 060, 001, 068, 008, 002, 001, 013, 008, 022, 001, 036, 008},
  266. {0, 000, 000},
  267. {2, 112, 020},
  268. {2, 000, 001},
  269. {2, 000, 001},
  270. {2, 000, 001},
  271. {2, 000, 001},
  272. {16, 081, 008, 032, 008, 043, 008, 067, 008, 011, 011, 008, 090, 002, 002, 083, 013},
  273. {2, 001, 001},
  274. {16, 058, 001, 069, 001, 075, 077, 018, 001, 032, 001, 045, 045, 013, 001, 034, 001},
  275. {16, 058, 001, 069, 001, 075, 077, 018, 001, 032, 001, 045, 045, 013, 001, 034, 001},
  276. {16, 067, 076, 068, 076, 078, 076, 002, 076, 016, 076, 018, 076, 025, 076, 045, 088},
  277. {16, 061, 008, 032, 008, 043, 008, 067, 008, 011, 011, 008, 090, 002, 002, 083, 013},
  278. {0, 000, 000},
  279. {0, 000, 000},
  280. {2, 001, 001},
  281. {2, 036, 036},
  282. {0, 000, 000},
  283. {0, 000, 000}
  284. };
  285. /*
  286. native GetVehicleParams(vehicleid, type);
  287. native SetVehicleParams(vehicleid, type, status, delay = 0);
  288. native GetVehicleBoot(vehicleid, &Float:x, &Float:y, &Float:z);
  289. native GetVehicleHood(vehicleid, &Float:x, &Float:y, &Float:z);
  290. native GetVehicleRoof(vehicleid, &Float:x, &Float:y, &Float:z);
  291. native GetVehicleRandomColors(modelid, &color1, &color2);
  292. native GetVehicleColor(vehicleid, &color1, &color2);
  293. native GetNearestVehicle(vehicleid);
  294. native GetVehiclePaintjob(vehicleid);
  295. native GetVehicleDriver(vehicleid);
  296. native GetVehicleTopSpeed(vehicleid);
  297. native GetVehicleInterior(vehicleid);
  298. native GetVehicleSeats(vehicleid);
  299. native GetVehicleModelSeats(modelid);
  300. native ResetVehiclePaintjob(vehicleid);
  301. native IsVehicleSeatOccupied(vehicleid, seatid);
  302. native IsValidVehicle(vehicleid);
  303. */
  304. forward EVF_SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  305. public EVF_SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective)
  306. {
  307. SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  308. }
  309. stock static ResetVehicleProperties(vehicleid)
  310. {
  311. s_VehicleTrailerID[vehicleid] = INVALID_VEHICLE_ID;
  312. for (new i = 0; i < _:e_VehicleProperties; i ++)
  313. {
  314. deleteproperty(4, !"", (vehicleid << 2) + i);
  315. }
  316. }
  317. stock static SetVehiclePropertyValue(vehicleid, type, value)
  318. {
  319. new
  320. string[12];
  321. format(string, sizeof(string), "%d", value);
  322. setproperty(4, !"", ((vehicleid << 2) + type), string);
  323. }
  324. stock static GetVehiclePropertyValue(vehicleid, type)
  325. {
  326. new
  327. string[12];
  328. getproperty(4, !"", ((vehicleid << 2) + type), string);
  329. return strval(string);
  330. }
  331. stock static IsVehiclePropertySet(vehicleid, type)
  332. {
  333. return existproperty(4, !"", (vehicleid << 2) + type);
  334. }
  335. stock GetVehicleRandomColors(modelid, &color1, &color2)
  336. {
  337. new
  338. index = 0;
  339. color1 = 0;
  340. color2 = 0;
  341. if (!(400 <= modelid <= 611))
  342. {
  343. return 0;
  344. }
  345. else
  346. {
  347. modelid -= 400;
  348. if (!s_CarColors[modelid][0])
  349. {
  350. return 0;
  351. }
  352. else if (s_CarColors[modelid][0] == 2)
  353. {
  354. color1 = s_CarColors[modelid][1];
  355. color2 = s_CarColors[modelid][2];
  356. }
  357. else
  358. {
  359. index = random(s_CarColors[modelid][0]) & -2;
  360. color1 = s_CarColors[modelid][++index];
  361. color2 = s_CarColors[modelid][++index];
  362. }
  363. }
  364. return 1;
  365. }
  366. stock GetVehicleParams(vehicleid, type)
  367. {
  368. new
  369. params[7]
  370. ;
  371. GetVehicleParamsEx(vehicleid, params[0], params[1], params[2], params[3], params[4], params[5], params[6]);
  372. return (!(params[type] <= 0));
  373. }
  374. stock SetVehicleParams(vehicleid, type, status, delay = 0)
  375. {
  376. new
  377. params[7];
  378. if (GetVehicleParamsEx(vehicleid, params[0], params[1], params[2], params[3], params[4], params[5], params[6]))
  379. {
  380. params[type] = status;
  381. if (delay > 0)
  382. {
  383. SetTimerEx("EVF_SetVehicleParamsEx", delay, false, "iiiiiiii", vehicleid, params[0], params[1], params[2], params[3], params[4], params[5], params[6]);
  384. }
  385. else
  386. {
  387. SetVehicleParamsEx(vehicleid, params[0], params[1], params[2], params[3], params[4], params[5], params[6]);
  388. }
  389. return 1;
  390. }
  391. return 0;
  392. }
  393. stock GetVehicleOffset(vehicleid, type, &Float:x, &Float:y, &Float:z)
  394. {
  395. new Float:fPos[4], Float:fSize[3];
  396. if (!IsValidVehicle(vehicleid))
  397. {
  398. x = 0.0;
  399. y = 0.0;
  400. z = 0.0;
  401. return 0;
  402. }
  403. else
  404. {
  405. GetVehiclePos(vehicleid, fPos[0], fPos[1], fPos[2]);
  406. GetVehicleZAngle(vehicleid, fPos[3]);
  407. GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZE, fSize[0], fSize[1], fSize[2]);
  408. switch (type)
  409. {
  410. case VEHICLE_OFFSET_BOOT:
  411. {
  412. x = fPos[0] - (floatsqroot(fSize[1] + fSize[1]) * floatsin(-fPos[3], degrees));
  413. y = fPos[1] - (floatsqroot(fSize[1] + fSize[1]) * floatcos(-fPos[3], degrees));
  414. z = fPos[2];
  415. }
  416. case VEHICLE_OFFSET_HOOD:
  417. {
  418. x = fPos[0] + (floatsqroot(fSize[1] + fSize[1]) * floatsin(-fPos[3], degrees));
  419. y = fPos[1] + (floatsqroot(fSize[1] + fSize[1]) * floatcos(-fPos[3], degrees));
  420. z = fPos[2];
  421. }
  422. case VEHICLE_OFFSET_ROOF:
  423. {
  424. x = fPos[0];
  425. y = fPos[1];
  426. z = fPos[2] + floatsqroot(fSize[2]);
  427. }
  428. }
  429. }
  430. return 1;
  431. }
  432. stock GetNearestVehicle(playerid)
  433. {
  434. new
  435. Float:fX,
  436. Float:fY,
  437. Float:fZ,
  438. Float:fSX,
  439. Float:fSY,
  440. Float:fSZ,
  441. Float:fRadius;
  442. for (new i = 1, j = GetVehiclePoolSize(); i <= j; i ++)
  443. {
  444. if (!IsVehicleStreamedIn(i, playerid))
  445. {
  446. continue;
  447. }
  448. else
  449. {
  450. GetVehiclePos(i, fX, fY, fZ);
  451. GetVehicleModelInfo(GetVehicleModel(i), VEHICLE_MODEL_INFO_SIZE, fSX, fSY, fSZ);
  452. fRadius = floatsqroot((fSX + fSX) + (fSY + fSY));
  453. if (IsPlayerInRangeOfPoint(playerid, fRadius, fX, fY, fZ) && GetPlayerInterior(playerid) == GetVehicleInterior(i) && GetPlayerVirtualWorld(playerid) == GetVehicleVirtualWorld(i))
  454. {
  455. return i;
  456. }
  457. }
  458. }
  459. return INVALID_VEHICLE_ID;
  460. }
  461. stock GetVehicleDriver(vehicleid)
  462. {
  463. for (new i = 0; i < MAX_PLAYERS; i ++)
  464. {
  465. if (GetPlayerState(i) == PLAYER_STATE_DRIVER && IsPlayerInVehicle(i, vehicleid))
  466. {
  467. return i;
  468. }
  469. }
  470. return INVALID_PLAYER_ID;
  471. }
  472. stock IsVehicleSeatOccupied(vehicleid, seatid)
  473. {
  474. if (!GetVehicleModel(vehicleid))
  475. {
  476. return 0;
  477. }
  478. else
  479. {
  480. for (new i = 0; i < MAX_PLAYERS; i ++)
  481. {
  482. if (IsPlayerInVehicle(i, vehicleid) && GetPlayerVehicleSeat(i) == seatid)
  483. {
  484. return 1;
  485. }
  486. }
  487. }
  488. return 0;
  489. }
  490. stock GetVehicleNextSeat(vehicleid, passenger = 1)
  491. {
  492. new
  493. seats = GetVehicleSeats(vehicleid);
  494. if (seats > 1)
  495. {
  496. for (new i = passenger; i < seats; i ++)
  497. {
  498. if (!IsVehicleSeatOccupied(vehicleid, i))
  499. {
  500. return i;
  501. }
  502. }
  503. }
  504. return INVALID_SEAT_ID;
  505. }
  506. stock GetVehicleModelSeats(modelid)
  507. {
  508. static const s_VehicleSeats[] =
  509. {
  510. 4, 2, 2, 2, 4, 4, 1, 2, 2, 4, 2, 2, 2, 4, 2, 2, 4, 2, 4, 2, 4, 4, 2, 2, 2, 1, 4, 4, 4, 2,
  511. 1, 7, 1, 2, 2, 0, 2, 7, 4, 2, 4, 1, 2, 2, 2, 4, 1, 2, 1, 0, 0, 2, 1, 1, 1, 2, 2, 2, 4,
  512. 4, 2, 2, 2, 2, 1, 1, 4, 4, 2, 2, 4, 2, 1, 1, 2, 2, 1, 2, 2, 4, 2, 1, 4, 3, 1, 1, 1, 4, 2,
  513. 2, 4, 2, 4, 1, 2, 2, 2, 4, 4, 2, 2, 1, 2, 2, 2, 2, 2, 4, 2, 1, 1, 2, 1, 1, 2, 2, 4, 2, 2,
  514. 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 4, 1, 1, 1, 2, 2, 2, 2, 7, 7, 1, 4, 2, 2, 2, 2, 2, 4, 4,
  515. 2, 2, 4, 4, 2, 1, 2, 2, 2, 2, 2, 2, 4, 4, 2, 2, 1, 2, 4, 4, 1, 0, 0, 1, 1, 2, 1, 2, 2, 1, 2,
  516. 4, 4, 2, 4, 1, 0, 4, 2, 2, 2, 2, 0, 0, 7, 2, 2, 1, 4, 4, 4, 2, 2, 2, 2, 2, 4, 2, 0, 0, 0,
  517. 4, 0, 0
  518. };
  519. return (modelid < 400 || modelid > 611) ? (0) : (s_VehicleSeats[(modelid - 400)]);
  520. }
  521. stock Float:GetVehicleTopSpeed(vehicleid)
  522. {
  523. new model = GetVehicleModel(vehicleid);
  524. if (model)
  525. {
  526. return float(s_TopSpeed[(model - 400)]);
  527. }
  528. return 0.0;
  529. }
  530. stock GetVehicleInterior(vehicleid)
  531. {
  532. if (IsValidVehicle(vehicleid))
  533. {
  534. return GetVehiclePropertyValue(vehicleid, e_VEHICLE_INTERIOR);
  535. }
  536. return 0;
  537. }
  538. stock GetVehicleColor(vehicleid, &color1, &color2)
  539. {
  540. if (IsValidVehicle(vehicleid))
  541. {
  542. color1 = GetVehiclePropertyValue(vehicleid, e_VEHICLE_COLOR_1);
  543. color2 = GetVehiclePropertyValue(vehicleid, e_VEHICLE_COLOR_2);
  544. return 1;
  545. }
  546. return 0;
  547. }
  548. stock GetVehiclePaintjob(vehicleid)
  549. {
  550. if (IsValidVehicle(vehicleid))
  551. {
  552. if (IsVehiclePropertySet(vehicleid, e_VEHICLE_PAINTJOB))
  553. {
  554. return GetVehiclePropertyValue(vehicleid, e_VEHICLE_PAINTJOB);
  555. }
  556. else
  557. {
  558. return INVALID_PAINTJOB_ID;
  559. }
  560. }
  561. return 0;
  562. }
  563. stock ResetVehiclePaintjob(vehicleid)
  564. {
  565. if (IsValidVehicle(vehicleid))
  566. {
  567. ChangeVehiclePaintjob(vehicleid, INVALID_PAINTJOB_ID);
  568. SetVehiclePropertyValue(vehicleid, e_VEHICLE_PAINTJOB, INVALID_PAINTJOB_ID);
  569. return 1;
  570. }
  571. return 0;
  572. }
  573. stock EVF_LinkVehicleToInterior(vehicleid, interiorid)
  574. {
  575. new
  576. ret = LinkVehicleToInterior(vehicleid, interiorid);
  577. if (ret)
  578. {
  579. SetVehiclePropertyValue(vehicleid, e_VEHICLE_INTERIOR, interiorid);
  580. }
  581. return ret;
  582. }
  583. stock EVF_CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:a, color1, color2, respawn_delay, addsiren = 0)
  584. {
  585. new vehicleid = INVALID_VEHICLE_ID;
  586. if (400 <= modelid <= 611)
  587. {
  588. new
  589. randcolor1,
  590. randcolor2;
  591. if (GetVehicleRandomColors(modelid, randcolor1, randcolor2))
  592. {
  593. if (color1 == -1)
  594. {
  595. color1 = randcolor1;
  596. }
  597. if (color2 == -1)
  598. {
  599. color2 = randcolor2;
  600. }
  601. }
  602. vehicleid = CreateVehicle(modelid, x, y, z, a, color1, color2, respawn_delay, addsiren);
  603. if (vehicleid != INVALID_VEHICLE_ID)
  604. {
  605. ResetVehicleProperties(vehicleid);
  606. SetVehiclePropertyValue(vehicleid, e_VEHICLE_COLOR_1, color1);
  607. SetVehiclePropertyValue(vehicleid, e_VEHICLE_COLOR_2, color2);
  608. CallLocalFunction("OnVehicleCreated", "i", vehicleid);
  609. }
  610. }
  611. return vehicleid;
  612. }
  613. stock EVF_DestroyVehicle(vehicleid)
  614. {
  615. if (IsValidVehicle(vehicleid))
  616. {
  617. if (CallLocalFunction("OnVehicleDestroyed", "i", vehicleid) > 0 || funcidx("OnVehicleDestroyed") == -1)
  618. {
  619. ResetVehicleProperties(vehicleid);
  620. return DestroyVehicle(vehicleid);
  621. }
  622. }
  623. return 0;
  624. }
  625. stock EVF_AddStaticVehicle(modelid, Float:x, Float:y, Float:z, Float:a, color1, color2)
  626. {
  627. new vehicleid = INVALID_VEHICLE_ID;
  628. if (400 <= modelid <= 611)
  629. {
  630. new
  631. randcolor1,
  632. randcolor2;
  633. if (GetVehicleRandomColors(modelid, randcolor1, randcolor2))
  634. {
  635. if (color1 == -1)
  636. {
  637. color1 = randcolor1;
  638. }
  639. if (color2 == -1)
  640. {
  641. color2 = randcolor2;
  642. }
  643. }
  644. vehicleid = AddStaticVehicle(modelid, x, y, z, a, color1, color2);
  645. if (vehicleid != INVALID_VEHICLE_ID)
  646. {
  647. ResetVehicleProperties(vehicleid);
  648. SetVehiclePropertyValue(vehicleid, e_VEHICLE_COLOR_1, color1);
  649. SetVehiclePropertyValue(vehicleid, e_VEHICLE_COLOR_2, color2);
  650. CallLocalFunction("OnVehicleCreated", "i", vehicleid);
  651. }
  652. }
  653. return vehicleid;
  654. }
  655. stock EVF_AddStaticVehicleEx(modelid, Float:x, Float:y, Float:z, Float:a, color1, color2, respawn_delay, addsiren = 0)
  656. {
  657. new vehicleid = INVALID_VEHICLE_ID;
  658. if (400 <= modelid <= 611)
  659. {
  660. new
  661. randcolor1,
  662. randcolor2;
  663. if (GetVehicleRandomColors(modelid, randcolor1, randcolor2))
  664. {
  665. if (color1 == -1)
  666. {
  667. color1 = randcolor1;
  668. }
  669. if (color2 == -1)
  670. {
  671. color2 = randcolor2;
  672. }
  673. }
  674. vehicleid = AddStaticVehicleEx(modelid, x, y, z, a, color1, color2, respawn_delay, addsiren);
  675. if (vehicleid != INVALID_VEHICLE_ID)
  676. {
  677. ResetVehicleProperties(vehicleid);
  678. SetVehiclePropertyValue(vehicleid, e_VEHICLE_COLOR_1, color1);
  679. SetVehiclePropertyValue(vehicleid, e_VEHICLE_COLOR_2, color2);
  680. CallLocalFunction("OnVehicleCreated", "i", vehicleid);
  681. }
  682. }
  683. return vehicleid;
  684. }
  685. stock EVF_ChangeVehicleColor(vehicleid, color1, color2)
  686. {
  687. new
  688. ret = ChangeVehicleColor(vehicleid, color1, color2);
  689. if (ret)
  690. {
  691. SetVehiclePropertyValue(vehicleid, e_VEHICLE_COLOR_1, color1);
  692. SetVehiclePropertyValue(vehicleid, e_VEHICLE_COLOR_2, color2);
  693. }
  694. return ret;
  695. }
  696. stock EVF_ChangeVehiclePaintjob(vehicleid, paintjobid)
  697. {
  698. new
  699. ret = ChangeVehiclePaintjob(vehicleid, paintjobid);
  700. if (ret)
  701. {
  702. SetVehiclePropertyValue(vehicleid, e_VEHICLE_PAINTJOB, paintjobid);
  703. }
  704. return ret;
  705. }
  706. public OnPlayerUpdate(playerid)
  707. {
  708. if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  709. {
  710. new
  711. vehicleid = GetPlayerVehicleID(playerid),
  712. trailerid = GetVehicleTrailer(vehicleid)
  713. ;
  714. if (s_VehicleTrailerID[vehicleid] != trailerid)
  715. {
  716. if (trailerid != 0)
  717. {
  718. CallLocalFunction("OnTrailerHooked", "iii", playerid, vehicleid, trailerid);
  719. }
  720. else
  721. {
  722. CallLocalFunction("OnTrailerUnhooked", "iii", playerid, vehicleid, s_VehicleTrailerID[vehicleid]);
  723. }
  724. s_VehicleTrailerID[vehicleid] = trailerid;
  725. }
  726. }
  727. #if defined EVF_OnPlayerUpdate
  728. return EVF_OnPlayerUpdate(playerid);
  729. #else
  730. return 1;
  731. #endif
  732. }
  733. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  734. {
  735. if ((hittype == BULLET_HIT_TYPE_VEHICLE) && (22 <= weaponid <= 38))
  736. {
  737. CallLocalFunction("OnPlayerShootVehicle", "iii", playerid, hitid, weaponid);
  738. }
  739. #if defined EVF_OnPlayerWeaponShot
  740. return EVF_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ);
  741. #else
  742. return 1;
  743. #endif
  744. }
  745. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  746. {
  747. SetVehiclePropertyValue(vehicleid, e_VEHICLE_COLOR_1, color1);
  748. SetVehiclePropertyValue(vehicleid, e_VEHICLE_COLOR_2, color2);
  749. #if defined EVF_OnVehicleRespray
  750. return EVF_OnVehicleRespray(playerid, vehicleid, color1, color2);
  751. #else
  752. return 1;
  753. #endif
  754. }
  755. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  756. {
  757. SetVehiclePropertyValue(vehicleid, e_VEHICLE_PAINTJOB, paintjobid);
  758. #if defined EVF_OnVehiclePaintjob
  759. return EVF_OnVehiclePaintjob(playerid, vehicleid, paintjobid);
  760. #else
  761. return 1;
  762. #endif
  763. }
  764. #if defined _ALS_LinkVehicleToInterior
  765. #define LinkVehicleToInterior
  766. #else
  767. #define _ALS_LinkVehicleToInterior
  768. #endif
  769. #if defined _ALS_CreateVehicle
  770. #define CreateVehicle
  771. #else
  772. #define _ALS_CreateVehicle
  773. #endif
  774. #if defined _ALS_DestroyVehicle
  775. #define DestroyVehicle
  776. #else
  777. #define _ALS_DestroyVehicle
  778. #endif
  779. #if defined _ALS_AddStaticVehicle
  780. #define AddStaticVehicle
  781. #else
  782. #define _ALS_AddStaticVehicle
  783. #endif
  784. #if defined _ALS_AddStaticVehicleEx
  785. #define AddStaticVehicleEx
  786. #else
  787. #define _ALS_AddStaticVehicleEx
  788. #endif
  789. #if defined _ALS_ChangeVehicleColor
  790. #define ChangeVehicleColor
  791. #else
  792. #define _ALS_ChangeVehicleColor
  793. #endif
  794. #if defined _ALS_ChangeVehiclePaintjob
  795. #define ChangeVehiclePaintjob
  796. #else
  797. #define _ALS_ChangeVehiclePaintjob
  798. #endif
  799. #if defined _ALS_OnPlayerUpdate
  800. #undef OnPlayerUpdate
  801. #else
  802. #define _ALS_OnPlayerUpdate
  803. #endif
  804. #if defined _ALS_OnPlayerWeaponShot
  805. #undef OnPlayerWeaponShot
  806. #else
  807. #define _ALS_OnPlayerWeaponShot
  808. #endif
  809. #if defined _ALS_OnVehicleRespray
  810. #undef OnVehicleRespray
  811. #else
  812. #define _ALS_OnVehicleRespray
  813. #endif
  814. #if defined _ALS_OnVehiclePaintjob
  815. #undef OnVehiclePaintjob
  816. #else
  817. #define _ALS_OnVehiclePaintjob
  818. #endif
  819. #define LinkVehicleToInterior EVF_LinkVehicleToInterior
  820. #define CreateVehicle EVF_CreateVehicle
  821. #define DestroyVehicle EVF_DestroyVehicle
  822. #define AddStaticVehicle EVF_AddStaticVehicle
  823. #define AddStaticVehicleEx EVF_AddStaticVehicleEx
  824. #define ChangeVehicleColor EVF_ChangeVehicleColor
  825. #define ChangeVehiclePaintjob EVF_ChangeVehiclePaintjob
  826. #define OnPlayerUpdate EVF_OnPlayerUpdate
  827. #define OnPlayerWeaponShot EVF_OnPlayerWeaponShot
  828. #define OnVehicleRespray EVF_OnVehicleRespray
  829. #define OnVehiclePaintjob EVF_OnVehiclePaintjob
  830. #if defined EVF_OnPlayerUpdate
  831. forward EVF_OnPlayerUpdate(playerid);
  832. #endif
  833. #if defined EVF_OnPlayerWeaponShot
  834. forward EVF_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
  835. #endif
  836. #if defined EVF_OnVehicleRespray
  837. forward EVF_OnVehicleRespray(playerid, vehicleid, color1, color2);
  838. #endif
  839. #if defined EVF_OnVehiclePaintjob
  840. forward EVF_OnVehiclePaintjob(playerid, vehicleid, paintjobid);
  841. #endif