Advertisement
domo101

Objekti za vozila

Aug 9th, 2016
524
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.90 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3.  
  4. enum _vehDat
  5. {
  6. _vehModel,
  7. Float:_attPos
  8. }
  9.  
  10. new attInfo[212][_vehDat] =
  11. {
  12. {400, 0.85},
  13. {401, 0.8},
  14. {402, 0.79},
  15. {403, 2.15},
  16. {404, -1.0},
  17. {405, 0.73},
  18. {406, -1.0},
  19. {407, -1.0},
  20. {408, -1.0},
  21. {409, 0.8},
  22. {410, 0.899999},
  23. {411, 0.699999},
  24. {412, 0.699999},
  25. {413, 1.149999},
  26. {414, 2.4},
  27. {415, 0.61},
  28. {416, -1.0},
  29. {417, -1.0},
  30. {418, 1.1},
  31. {419, 0.699999},
  32. {420, -1.0},
  33. {421, 0.699999},
  34. {422, -1.0},
  35. {423, -1.0},
  36. {424, -1.0},
  37. {425, -1.0},
  38. {426, 0.85},
  39. {427, -1.0},
  40. {428, 1.6},
  41. {429, -1.0},
  42. {430, -1.0},
  43. {431, -1.0},
  44. {432, -1.0},
  45. {433, -1.0},
  46. {434, 0.8},
  47. {435, -1.0},
  48. {436, 0.8},
  49. {437, -1.0},
  50. {438, -1.0},
  51. {439, -1.0},
  52. {440, 1.269999},
  53. {441, -1.0},
  54. {442, 0.92},
  55. {443, -1.0},
  56. {444, -1.0},
  57. {445, 0.86},
  58. {446, -1.0},
  59. {447, -1.0},
  60. {448, -1.0},
  61. {449, -1.0},
  62. {450, -1.0},
  63. {451, 0.569999},
  64. {452, -1.0},
  65. {453, -1.0},
  66. {454, -1.0},
  67. {455, -1.0},
  68. {456, -1.0},
  69. {457, -1.0},
  70. {458, 0.759999},
  71. {459, -1.0},
  72. {460, -1.0},
  73. {461, -1.0},
  74. {462, -1.0},
  75. {463, -1.0},
  76. {464, -1.0},
  77. {465, -1.0},
  78. {466, 0.86},
  79. {467, 0.86},
  80. {468, -1.0},
  81. {469, -1.0},
  82. {470, 1.1},
  83. {471, -1.0},
  84. {472, -1.0},
  85. {473, -1.0},
  86. {474, 0.839999},
  87. {475, 0.699999},
  88. {476, -1.0},
  89. {477, 0.699999},
  90. {478, -1.0},
  91. {479, 1.0},
  92. {480, -1.0},
  93. {481, -1.0},
  94. {482, 1.0},
  95. {483, 1.049999},
  96. {484, -1.0},
  97. {485, -1.0},
  98. {486, -1.0},
  99. {487, -1.0},
  100. {488, -1.0},
  101. {489, 1.1},
  102. {490, -1.0},
  103. {491, 0.699999},
  104. {492, 0.87},
  105. {493, -1.0},
  106. {494, 0.74},
  107. {495, 1.039999},
  108. {496, 0.839999},
  109. {497, -1.0},
  110. {498, -1.0},
  111. {499, -1.0},
  112. {500, 1.0},
  113. {501, -1.0},
  114. {502, -1.0},
  115. {503, -1.0},
  116. {504, 0.899999},
  117. {505, -1.0},
  118. {506, -1.0},
  119. {507, 0.81},
  120. {508, -1.0},
  121. {509, -1.0},
  122. {510, -1.0},
  123. {511, -1.0},
  124. {512, -1.0},
  125. {513, -1.0},
  126. {514, 1.549999},
  127. {515, 1.47},
  128. {516, 0.86},
  129. {517, 0.86},
  130. {518, 0.699999},
  131. {519, -1.0},
  132. {520, -1.0},
  133. {521, -1.0},
  134. {522, -1.0},
  135. {523, -1.0},
  136. {524, -1.0},
  137. {525, -1.0},
  138. {526, 0.68},
  139. {527, 0.85},
  140. {528, 1.1},
  141. {529, 0.92},
  142. {530, -1.0},
  143. {531, -1.0},
  144. {532, -1.0},
  145. {533, -1.0},
  146. {534, 0.649999},
  147. {535, -1.0},
  148. {536, -1.0},
  149. {537, -1.0},
  150. {538, -1.0},
  151. {539, -1.0},
  152. {540, 0.73},
  153. {541, 0.639999},
  154. {542, 0.85},
  155. {543, -1.0},
  156. {544, -1.0},
  157. {545, 0.769999},
  158. {546, 0.85},
  159. {547, 0.899999},
  160. {548, -1.0},
  161. {549, 0.709999},
  162. {550, 0.74},
  163. {551, 0.899999},
  164. {552, -1.0},
  165. {553, -1.0},
  166. {554, -1.0},
  167. {555, -1.0},
  168. {556, -1.0},
  169. {557, -1.0},
  170. {558, 0.87},
  171. {559, 0.759999},
  172. {560, 0.87},
  173. {561, 0.87},
  174. {562, 0.8},
  175. {563, -1.0},
  176. {564, -1.0},
  177. {565, 0.699999},
  178. {566, 0.85},
  179. {567, -1.0},
  180. {568, -1.0},
  181. {569, -1.0},
  182. {570, -1.0},
  183. {571, -1.0},
  184. {572, -1.0},
  185. {573, -1.0},
  186. {574, -1.0},
  187. {575, -1.0},
  188. {576, 0.899999},
  189. {577, -1.0},
  190. {578, -1.0},
  191. {579, 1.24},
  192. {580, 1.059999},
  193. {581, -1.0},
  194. {582, -1.0},
  195. {583, -1.0},
  196. {584, -1.0},
  197. {585, 1.0},
  198. {586, -1.0},
  199. {587, 0.73},
  200. {588, -1.0},
  201. {589, 1.1},
  202. {590, -1.0},
  203. {591, -1.0},
  204. {592, -1.0},
  205. {593, -1.0},
  206. {594, -1.0},
  207. {595, -1.0},
  208. {596, -1.0},
  209. {597, -1.0},
  210. {598, -1.0},
  211. {599, -1.0},
  212. {600, -1.0},
  213. {601, -1.0},
  214. {602, 0.709999},
  215. {603, 0.68},
  216. {604, -1.0},
  217. {605, -1.0},
  218. {606, -1.0},
  219. {607, -1.0},
  220. {608, -1.0},
  221. {609, -1.0},
  222. {610, -1.0},
  223. {611, -1.0}
  224. };
  225.  
  226. enum _vehicleInfo
  227. {
  228. attachObject,
  229. bool:useAttach
  230. }
  231.  
  232. new vehicleInfo[MAX_VEHICLES][_vehicleInfo];
  233.  
  234. CMD:sirena(playerid, params[])
  235. {
  236. if(!IsPlayerInAnyVehicle(playerid))
  237. {
  238. SendClientMessage(playerid, -1, "Nisi u vozilu!");
  239. return 1;
  240. }
  241.  
  242. new id = GetPlayerVehicleID(playerid);
  243. if(attInfo[GetVehicleModel(id) - 400][_attPos] != -1.0)
  244. {
  245. if(vehicleInfo[id][useAttach])
  246. {
  247. DestroyObject(vehicleInfo[id][attachObject]);
  248. }
  249.  
  250. vehicleInfo[id][attachObject] = CreateObject(19419, 10.0, 10.0, 10.0, 0, 0, 0);
  251. vehicleInfo[id][useAttach] = true;
  252. AttachObjectToVehicle(vehicleInfo[id][attachObject], GetPlayerVehicleID(playerid), -0.0, -0.39, attInfo[GetVehicleModel(id) - 400][_attPos], 0.0, 0.0, 0.0);
  253. SendClientMessage(playerid, -1, "Stavili ste policijsku sirenu na vozilo.");
  254. PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
  255. }
  256. return 1;
  257. }
  258.  
  259. CMD:psvjetlo(playerid, params[])
  260. {
  261. if(!IsPlayerInAnyVehicle(playerid))
  262. {
  263. SendClientMessage(playerid, -1, "Nisi u vozilu!");
  264. return 1;
  265. }
  266.  
  267. new id = GetPlayerVehicleID(playerid);
  268. if(attInfo[GetVehicleModel(id) - 400][_attPos] != -1.0)
  269. {
  270. if(vehicleInfo[id][useAttach])
  271. {
  272. DestroyObject(vehicleInfo[id][attachObject]);
  273. }
  274.  
  275. vehicleInfo[id][attachObject] = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0);
  276. vehicleInfo[id][useAttach] = true;
  277. AttachObjectToVehicle(vehicleInfo[id][attachObject], GetPlayerVehicleID(playerid), -0.0, -0.39, attInfo[GetVehicleModel(id) - 400][_attPos] + 0.1, 0.0, 0.0, 0.0);
  278. SendClientMessage(playerid, -1, "Stavili ste policijsko svjetlo na vozilo.");
  279. PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
  280. }
  281. return 1;
  282. }
  283.  
  284. CMD:taxi(playerid, params[])
  285. {
  286. if(!IsPlayerInAnyVehicle(playerid))
  287. {
  288. SendClientMessage(playerid, -1, "Nisi u vozilu!");
  289. return 1;
  290. }
  291.  
  292. new id = GetPlayerVehicleID(playerid);
  293. if(attInfo[GetVehicleModel(id) - 400][_attPos] != -1.0)
  294. {
  295. if(vehicleInfo[id][useAttach])
  296. {
  297. DestroyObject(vehicleInfo[id][attachObject]);
  298. }
  299.  
  300. vehicleInfo[id][attachObject] = CreateObject(19308, 10.0, 10.0, 10.0, 0, 0, 0);
  301. vehicleInfo[id][useAttach] = true;
  302. AttachObjectToVehicle(vehicleInfo[id][attachObject], GetPlayerVehicleID(playerid), -0.0, -0.39, attInfo[GetVehicleModel(id) - 400][_attPos] + 0.1, 0.0, 0.0, 0.0);
  303. SendClientMessage(playerid, -1, "Stavili ste 'TAXI' znak na vozilo");
  304. PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
  305. }
  306. return 1;
  307. }
  308.  
  309. CMD:skiniobjekt(playerid, params[])
  310. {
  311. if(!IsPlayerInAnyVehicle(playerid))
  312. {
  313. SendClientMessage(playerid, -1, "Nisi u vozilu!");
  314. return 1;
  315. }
  316.  
  317. new vehicleid = GetPlayerVehicleID(playerid);
  318. if(vehicleInfo[vehicleid][useAttach])
  319. {
  320. DestroyObject(vehicleInfo[vehicleid][attachObject]);
  321. PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
  322. }
  323. return 1;
  324. }
  325.  
  326.  
  327. public OnFilterScriptInit()
  328. {
  329. for(new i = 0; i < MAX_VEHICLES; i++)
  330. {
  331. vehicleInfo[i][useAttach] = false;
  332. }
  333. return 1;
  334. }
  335.  
  336.  
  337. public OnVehicleSpawn(vehicleid)
  338. {
  339. if(vehicleInfo[vehicleid][useAttach])
  340. {
  341. DestroyObject(vehicleInfo[vehicleid][attachObject]);
  342. }
  343. return 1;
  344. }
  345.  
  346. public OnVehicleDeath(vehicleid, killerid)
  347. {
  348. if(vehicleInfo[vehicleid][useAttach])
  349. {
  350. DestroyObject(vehicleInfo[vehicleid][attachObject]);
  351. }
  352. return 1;
  353. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement