Lifer

Untitled

Jul 25th, 2011
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.22 KB | None | 0 0
  1. #include <a_samp>
  2. new motor[MAX_PLAYERS], luz[MAX_PLAYERS], alarme[MAX_PLAYERS], portas[MAX_PLAYERS], capo[MAX_PLAYERS], portamalas[MAX_PLAYERS], objetivo[MAX_PLAYERS];
  3. #if defined FILTERSCRIPT
  4.  
  5. public OnFilterScriptInit()
  6. {
  7. print("\n--------------------------------------");
  8. print(" Sistema de Motor Simples By:Lifer");
  9. print("--------------------------------------\n");
  10. ManualVehicleEngineAndLights();
  11. return 1;
  12. }
  13.  
  14. public OnFilterScriptExit()
  15. {
  16. return 1;
  17. }
  18. #endif
  19. public OnPlayerCommandText(playerid, cmdtext[])
  20. {
  21. if (strcmp("/motoron", cmdtext, true, 10) == 0)
  22. {
  23. new mot, lu, alar, por, cap, porma, ob;
  24. new carro = GetPlayerVehicleID(playerid);
  25. if(carro != INVALID_VEHICLE_ID)
  26. {
  27. if(motor[playerid] == 0)
  28. {
  29. GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
  30. SetVehicleParamsEx(carro, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob);
  31. motor[playerid] = 1;
  32. SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {2F991A}Ligado!");
  33. }
  34. }
  35. }
  36. if (strcmp("/motoroff", cmdtext, true, 10) == 0)
  37. {
  38. new mot, lu, alar, por, cap, porma, ob;
  39. new carro = GetPlayerVehicleID(playerid);
  40. if(carro != INVALID_VEHICLE_ID)
  41. {
  42. if(motor[playerid] == 1)
  43. {
  44. GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
  45. SetVehicleParamsEx(carro, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
  46. motor[playerid] = 0;
  47. SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {E31919}Desligado!");
  48. }
  49. }
  50. }
  51. if (strcmp("/farolon", cmdtext, true, 10) == 0)
  52. {
  53. new mot, lu, alar, por, cap, porma, ob;
  54. new carro = GetPlayerVehicleID(playerid);
  55. if(carro != INVALID_VEHICLE_ID)
  56. {
  57. if(luz[playerid] == 0)
  58. {
  59. GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
  60. SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
  61. luz[playerid] = 1;
  62. SendClientMessage(playerid, 0xFFFFFFAA, "Farol {2F991A}Ligado!");
  63. }
  64. }
  65. }
  66. if (strcmp("/faroloff", cmdtext, true, 10) == 0)
  67. {
  68. new mot, lu, alar, por, cap, porma, ob;
  69. new carro = GetPlayerVehicleID(playerid);
  70. if(carro != INVALID_VEHICLE_ID)
  71. {
  72. if(luz[playerid] == 1)
  73. {
  74. GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
  75. SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_OFF, alar, por, cap, porma, ob);
  76. luz[playerid] = 0;
  77. SendClientMessage(playerid, 0xFFFFFFAA, "Farol {E31919}Desligado!");
  78. }
  79. }
  80. }
  81. if (strcmp("/alarmeon", cmdtext, true, 10) == 0)
  82. {
  83. new mot, lu, alar, por, cap, porma, ob;
  84. new carro = GetPlayerVehicleID(playerid);
  85. if(carro != INVALID_VEHICLE_ID)
  86. {
  87. if(alarme[playerid] == 0)
  88. {
  89. GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
  90. SetVehicleParamsEx(carro, mot, lu, VEHICLE_PARAMS_ON, por, cap, porma, ob);
  91. alarme[playerid] = 1;
  92. SendClientMessage(playerid, 0xFFFFFFAA, "Alarme {2F991A}Ligado!");
  93. }
  94. }
  95. }
  96. if (strcmp("/alarmeoff", cmdtext, true, 10) == 0)
  97. {
  98. new mot, lu, alar, por, cap, porma, ob;
  99. new carro = GetPlayerVehicleID(playerid);
  100. if(carro != INVALID_VEHICLE_ID)
  101. {
  102. if(alarme[playerid] == 1)
  103. {
  104. GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
  105. SetVehicleParamsEx(carro, mot, lu,VEHICLE_PARAMS_OFF, por, cap, porma, ob);
  106. alarme[playerid] = 0;
  107. SendClientMessage(playerid, 0xFFFFFFAA, "Alarme {E31919}Desligado!");
  108. }
  109. }
  110. }
  111. if (strcmp("/portaon", cmdtext, true, 10) == 0)
  112. {
  113. new mot, lu, alar, por, cap, porma, ob;
  114. new carro = GetPlayerVehicleID(playerid);
  115. if(carro != INVALID_VEHICLE_ID)
  116. {
  117. if(portas[playerid] == 0)
  118. {
  119. GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
  120. SetVehicleParamsEx(carro, mot, lu, alar, VEHICLE_PARAMS_ON, cap, porma, ob);
  121. portas[playerid] = 1;
  122. SendClientMessage(playerid, 0xFFFFFFAA, "Portas {2F991A}Abertas!");
  123. }
  124. }
  125. }
  126. if (strcmp("/portaoff", cmdtext, true, 10) == 0)
  127. {
  128. new mot, lu, alar, por, cap, porma, ob;
  129. new carro = GetPlayerVehicleID(playerid);
  130. if(carro != INVALID_VEHICLE_ID)
  131. {
  132. if(portas[playerid] == 1)
  133. {
  134. GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
  135. SetVehicleParamsEx(carro, mot, lu, alar, VEHICLE_PARAMS_OFF, cap, porma, ob);
  136. portas[playerid] = 0;
  137. SendClientMessage(playerid, 0xFFFFFFAA, "Portas {E31919}Fechadas!");
  138. }
  139. }
  140. }
  141. if (strcmp("/capoon", cmdtext, true, 10) == 0)
  142. {
  143. new mot, lu, alar, por, cap, porma, ob;
  144. new carro = GetPlayerVehicleID(playerid);
  145. if(carro != INVALID_VEHICLE_ID)
  146. {
  147. if(capo[playerid] == 0)
  148. {
  149. GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
  150. SetVehicleParamsEx(carro, mot, lu, alar, por, VEHICLE_PARAMS_ON, porma, ob);
  151. capo[playerid] = 1;
  152. SendClientMessage(playerid, 0xFFFFFFAA, "Capo {2F991A}Aberto!");
  153. }
  154. }
  155. }
  156. if (strcmp("/capooff", cmdtext, true, 10) == 0)
  157. {
  158. new mot, lu, alar, por, cap, porma, ob;
  159. new carro = GetPlayerVehicleID(playerid);
  160. if(carro != INVALID_VEHICLE_ID)
  161. {
  162. if(capo[playerid] == 1)
  163. {
  164. GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
  165. SetVehicleParamsEx(carro, mot, lu, alar, por, VEHICLE_PARAMS_OFF, porma, ob);
  166. capo[playerid] = 0;
  167. SendClientMessage(playerid, 0xFFFFFFAA, "Capo {E31919}Fechado!");
  168. }
  169. }
  170. }
  171. if (strcmp("/pmalaon", cmdtext, true, 10) == 0)
  172. {
  173. new mot, lu, alar, por, cap, porma, ob;
  174. new carro = GetPlayerVehicleID(playerid);
  175. if(carro != INVALID_VEHICLE_ID)
  176. {
  177. if(portamalas[playerid] == 0)
  178. {
  179. GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
  180. SetVehicleParamsEx(carro, mot, lu, alar, por, cap, VEHICLE_PARAMS_ON, ob);
  181. portamalas[playerid] = 1;
  182. SendClientMessage(playerid, 0xFFFFFFAA, "Portamalas {2F991A}Aberto!");
  183. }
  184. }
  185. }
  186. if (strcmp("/pmalaoff", cmdtext, true, 10) == 0)
  187. {
  188. new mot, lu, alar, por, cap, porma, ob;
  189. new carro = GetPlayerVehicleID(playerid);
  190. if(carro != INVALID_VEHICLE_ID)
  191. {
  192. if(portamalas[playerid] == 1)
  193. {
  194. GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
  195. SetVehicleParamsEx(carro, mot, lu, alar, por, cap, VEHICLE_PARAMS_OFF, ob);
  196. portamalas[playerid] = 0;
  197. SendClientMessage(playerid, 0xFFFFFFAA, "Portamalas {E31919}Fechado!");
  198. }
  199. }
  200. }
  201. if (strcmp("/marcaon", cmdtext, true, 10) == 0)
  202. {
  203. new mot, lu, alar, por, cap, porma, ob;
  204. new carro = GetPlayerVehicleID(playerid);
  205. if(carro != INVALID_VEHICLE_ID)
  206. {
  207. if(objetivo[playerid] == 0)
  208. {
  209. GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
  210. SetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, VEHICLE_PARAMS_ON);
  211. objetivo[playerid] = 1;
  212. SendClientMessage(playerid, 0xFFFFFFAA, "Marca {2F991A}Ativada!");
  213. }
  214. }
  215. }
  216. if (strcmp("/marcaoff", cmdtext, true, 10) == 0)
  217. {
  218. new mot, lu, alar, por, cap, porma, ob;
  219. new carro = GetPlayerVehicleID(playerid);
  220. if(carro != INVALID_VEHICLE_ID)
  221. {
  222. if(objetivo[playerid] == 1)
  223. {
  224. GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
  225. SetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, VEHICLE_PARAMS_OFF);
  226. objetivo[playerid] = 0;
  227. SendClientMessage(playerid, 0xFFFFFFAA, "Marca {E31919}Desativada!");
  228. }
  229. }
  230. }
  231. return 1;
  232. }
  233. return 0;
  234. }
Advertisement
Add Comment
Please, Sign In to add comment