Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- // Codes de uso livre! Apenas reconheça o trabalho e deixe os creditos!
- public OnFilterScriptInit()
- {
- print("________________________________________");
- print("Sistema simples de inginição do veiculo ");
- print(" By Nill.Oliveira ");
- print("________________________________________");
- return 1;
- }
- /*----------------------------------------------------------------------------*/
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/farol", cmdtext, true, 10) == 0)
- {
- new luz[MAX_VEHICLES];
- new motor, farol, alarme, porta, capo, portamala, objetivo;
- new carro = GetPlayerVehicleID(playerid);
- if(carro != INVALID_VEHICLE_ID)
- {
- if(luz[playerid] == 0)
- {
- GetVehicleParamsEx(carro, motor, farol, alarme, porta, capo, portamala, objetivo);
- SetVehicleParamsEx(carro, motor, VEHICLE_PARAMS_ON, alarme, porta, capo, portamala, objetivo);
- luz[playerid] = 1;
- SendClientMessage(playerid, -1, "Farol do veiculo Ligado.");
- }
- else if(luz[playerid] == 1)
- {
- GetVehicleParamsEx(carro, motor, farol, alarme, porta, capo, portamala, objetivo);
- SetVehicleParamsEx(carro, motor, VEHICLE_PARAMS_OFF, alarme, porta, capo, portamala, objetivo);
- luz[playerid] = 0;
- SendClientMessage(playerid, -1, "Farol do veiculo Desligado.");
- }
- }
- }
- if (strcmp("/motor", cmdtext, true, 10) == 0)
- {
- new enginicao[MAX_VEHICLES];
- new motor, farol, alarme, portas, capo, portamalas, objetivo;
- new carro = GetPlayerVehicleID(playerid);
- if(carro != INVALID_VEHICLE_ID)
- {
- if(enginicao[playerid] == 0)
- {
- GetVehicleParamsEx(carro, motor, farol, alarme, portas, capo, portamalas, objetivo);
- SetVehicleParamsEx(carro, VEHICLE_PARAMS_ON, farol, alarme, portas, capo, portamalas, objetivo);
- enginicao[playerid] = 1;
- SendClientMessage(playerid, -1, "Motor do veiculo Ligado.");
- }
- else if(enginicao[playerid] == 1)
- {
- GetVehicleParamsEx(carro, motor, farol, alarme, portas, capo, portamalas, objetivo);
- SetVehicleParamsEx(carro, VEHICLE_PARAMS_OFF, farol, alarme, portas, capo, portamalas, objetivo);
- enginicao[playerid] = 0;
- SendClientMessage(playerid, -1, "Motor do veiculo Desligado.");
- }
- }
- }
- if (strcmp("/repararcarro", cmdtext, true) == 0)
- {
- if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage (playerid, 0x00FF00AA, "Você não está em um veiculo.");
- {
- new veiculo = GetPlayerVehicleID (playerid);
- SetVehicleHealth (veiculo, 1000.0);
- SendClientMessage (playerid, -1, "O motor do veículo foi totalmente consertado.");
- return 1;
- }
- }
- return 0;
- }
- /*----------------------------------------------------------------------------*/
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Ligar ou desligar a Luz do veiculo precione [Y] e motor [N].");
- new motor, farol, alarme, portas, capo, portamalas, objetivo;
- {
- GetVehicleParamsEx(vehicleid, motor, farol, alarme, portas, capo, portamalas, objetivo);
- SetVehicleParamsEx(vehicleid, motor, farol, alarme, portas, capo, portamalas, objetivo);
- }
- return 1;
- }
- /*----------------------------------------------------------------------------*/
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Desligue o motor do veiculo, poupe seu combustivel!");
- return 1;
- }
- /*----------------------------------------------------------------------------*/
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if((newkeys == 65536) && (IsPlayerInAnyVehicle(playerid)))
- {
- OnPlayerCommandText(playerid, "/farol");
- return 1;
- }
- if((newkeys == 131072) && (IsPlayerInAnyVehicle(playerid)))
- {
- OnPlayerCommandText(playerid, "/motor");
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment