Guest User

Untitled

a guest
Nov 29th, 2010
441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.57 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3.  
  4. new EngineStatus[MAX_PLAYERS], LightsStatus[MAX_PLAYERS], AlarmStatus[MAX_PLAYERS], DoorsStatus[MAX_PLAYERS], BonnetStatus[MAX_PLAYERS], BootStatus[MAX_PLAYERS], ObjectiveStatus[MAX_PLAYERS];
  5.  
  6. public OnFilterScriptInit()
  7. {
  8. print("\n--------------------------------------");
  9. print(" Sistema de veiculo SA:MP 0.3c R1 Ativado");
  10. print(" Codigo by Auxxx");
  11. print(" Tradução:jonas_OwNer");
  12. print("--------------------------------------\n");
  13. return 1;
  14. }
  15.  
  16. public OnFilterScriptExit()
  17. {
  18. print("\n--------------------------------------");
  19. print(" Sistema de veiculo SA:MP 0.3c R1 Desativado");
  20. print(" Codigo by Auxxx");
  21. print(" Tradução:jonas_OwNer");
  22. print("--------------------------------------\n");
  23. return 1;
  24. }
  25.  
  26. public OnGameModeInit()
  27. {
  28. ManualVehicleEngineAndLights();
  29. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  30. return 1;
  31. }
  32.  
  33. CMD:veh(playerid, params[])
  34. {
  35. new engine,lights,alarm,doors,bonnet,boot,objective;
  36. new veh = GetPlayerVehicleID(playerid);
  37. if(strcmp(params, "Ligar", true) == 0)
  38. {
  39. if(IsPlayerInAnyVehicle(playerid))
  40. {
  41. if(veh != INVALID_VEHICLE_ID)
  42. {
  43. if(EngineStatus[playerid] == 0)
  44. {
  45. GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
  46. SetVehicleParamsEx(veh,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
  47. EngineStatus[playerid] = 1;
  48. SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {2F991A}Ligado!");
  49. }
  50. else if(EngineStatus[playerid] == 1)
  51. {
  52. GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
  53. SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
  54. EngineStatus[playerid] = 0;
  55. SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {E31919}Desligado!");
  56. }
  57. }
  58. }
  59. else {
  60. SendClientMessage(playerid, 0x00FF00FF, "{E31919}Você não está em um veiculo!");
  61. }
  62. }
  63. else if(strcmp(params, "Luzes", true) == 0)
  64. {
  65. if(IsPlayerInAnyVehicle(playerid))
  66. {
  67. if(veh != INVALID_VEHICLE_ID)
  68. {
  69. if(LightsStatus[playerid] == 0)
  70. {
  71. GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
  72. SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
  73. LightsStatus[playerid] = 1;
  74. SendClientMessage(playerid, 0xFFFFFFAA, "Luzes do Veiculo {2F991A}Ligadas!");
  75. }
  76. else if(LightsStatus[playerid] == 1)
  77. {
  78. GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
  79. SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
  80. LightsStatus[playerid] = 0;
  81. SendClientMessage(playerid, 0xFFFFFFAA, "Luzes do Veiculo {E31919}Desligadas!");
  82. }
  83. }
  84. }
  85. else {
  86. SendClientMessage(playerid, 0x00FF00FF, "{E31919}Você não está em um veiculo!");
  87. }
  88. }
  89. else if(strcmp(params, "Alarme", true) == 0)
  90. {
  91. if(IsPlayerInAnyVehicle(playerid))
  92. {
  93. if(veh != INVALID_VEHICLE_ID)
  94. {
  95. if(AlarmStatus[playerid] == 0)
  96. {
  97. GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
  98. SetVehicleParamsEx(veh,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
  99. AlarmStatus[playerid] = 1;
  100. SendClientMessage(playerid, 0xFFFFFFAA, "Alarme {2F991A}Ligado!");
  101. }
  102. else if(AlarmStatus[playerid] == 1)
  103. {
  104. GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
  105. SetVehicleParamsEx(veh,engine,lights,VEHICLE_PARAMS_OFF,doors,bonnet,boot,objective);
  106. AlarmStatus[playerid] = 0;
  107. SendClientMessage(playerid, 0xFFFFFFAA, "Alarme {E31919}Desligado!");
  108. }
  109. }
  110. }
  111. else {
  112. SendClientMessage(playerid, 0x00FF00FF, "{E31919}Você não está em veiculo!");
  113. }
  114. }
  115. else if(strcmp(params, "Portas", true) == 0)
  116. {
  117. if(IsPlayerInAnyVehicle(playerid))
  118. {
  119. if(veh != INVALID_VEHICLE_ID)
  120. {
  121. if(DoorsStatus[playerid] == 0)
  122. {
  123. GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
  124. SetVehicleParamsEx(veh,engine,lights,alarm,VEHICLE_PARAMS_ON,bonnet,boot,objective);
  125. DoorsStatus[playerid] = 1;
  126. SendClientMessage(playerid, 0xFFFFFFAA, "Portas {2F991A}Abertas!");
  127. }
  128. else if(DoorsStatus[playerid] == 1)
  129. {
  130. GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
  131. SetVehicleParamsEx(veh,engine,lights,alarm,VEHICLE_PARAMS_OFF,bonnet,boot,objective);
  132. DoorsStatus[playerid] = 0;
  133. SendClientMessage(playerid, 0xFFFFFFAA, "Portas {E31919}Fechadas!");
  134. }
  135. }
  136. }
  137. else {
  138. SendClientMessage(playerid, 0x00FF00FF, "{E31919}Você não está em um veiculo!");
  139. }
  140. }
  141. else if(strcmp(params, "Capo", true) == 0)
  142. {
  143. if(IsPlayerInAnyVehicle(playerid))
  144. {
  145. if(veh != INVALID_VEHICLE_ID)
  146. {
  147. if(BonnetStatus[playerid] == 0)
  148. {
  149. GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
  150. SetVehicleParamsEx(veh,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
  151. BonnetStatus[playerid] = 1;
  152. SendClientMessage(playerid, 0xFFFFFFAA, "Capo do veiculo {2F991A}Aberto!");
  153. }
  154. else if(BonnetStatus[playerid] == 1)
  155. {
  156. GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
  157. SetVehicleParamsEx(veh,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
  158. BonnetStatus[playerid] = 0;
  159. SendClientMessage(playerid, 0xFFFFFFAA, "Capo do Veiculo {E31919}Fechado!");
  160. }
  161. }
  162. }
  163. else {
  164. SendClientMessage(playerid, 0x00FF00FF, "{E31919}Você não está em um veiculo!");
  165. }
  166. }
  167. else if(strcmp(params, "Pmalas", true) == 0)
  168. {
  169. if(IsPlayerInAnyVehicle(playerid))
  170. {
  171. if(veh != INVALID_VEHICLE_ID)
  172. {
  173. if(BootStatus[playerid] == 0)
  174. {
  175. GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
  176. SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
  177. BootStatus[playerid] = 1;
  178. SendClientMessage(playerid, 0xFFFFFFAA, "Porta Malas {2F991A}Aberto!");
  179. }
  180. else if(BootStatus[playerid] == 1)
  181. {
  182. GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
  183. SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
  184. BootStatus[playerid] = 0;
  185. SendClientMessage(playerid, 0xFFFFFFAA, "Porta Malas {E31919}Fechado!");
  186. }
  187. }
  188. }
  189. else {
  190. SendClientMessage(playerid, 0x00FF00FF, "{E31919}Você não está em um veiculo!");
  191. }
  192. }
  193. else if(strcmp(params, "Marcar", true) == 0)
  194. {
  195. if(IsPlayerInAnyVehicle(playerid))
  196. {
  197. if(veh != INVALID_VEHICLE_ID)
  198. {
  199. if(ObjectiveStatus[playerid] == 0)
  200. {
  201. GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
  202. SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,VEHICLE_PARAMS_ON);
  203. ObjectiveStatus[playerid] = 1;
  204. SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo Marcado no Mapa {2F991A}Ativado!");
  205. }
  206. else if(ObjectiveStatus[playerid] == 1)
  207. {
  208. GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
  209. SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,VEHICLE_PARAMS_OFF);
  210. ObjectiveStatus[playerid] = 0;
  211. SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo Marcado no Mapa {E31919}Desativado!");
  212. }
  213. }
  214. }
  215. else {
  216. SendClientMessage(playerid, 0x00FF00FF, "{E31919}Você não está em um veiculo!");
  217. }
  218. }
  219. else SendClientMessage(playerid, 0xFFFFFFAA, "/veh [função]"),
  220. SendClientMessage(playerid, 0xFFFFFFAA, "Opções: Ligar/desligar, Luzes, Alarme, Portas, Capo, Pmalas, Marcar");
  221. return 1;
  222. }
Advertisement
Add Comment
Please, Sign In to add comment