SHOW:
|
|
- or go back to the newest paste.
| 1 | #include <a_samp> | |
| 2 | ||
| 3 | // Codes de uso livre! Apenas reconheça o trabalho e deixe os creditos! | |
| 4 | ||
| 5 | - | // [FS|N-O]Engnição do veiculo |
| 5 | + | |
| 6 | - | #if defined FILTERSCRIPT |
| 6 | + | |
| 7 | print("________________________________________");
| |
| 8 | print("Sistema simples de inginição do veiculo ");
| |
| 9 | print(" By Nill.Oliveira ");
| |
| 10 | print("________________________________________");
| |
| 11 | return 1; | |
| 12 | } | |
| 13 | /*----------------------------------------------------------------------------*/ | |
| 14 | public OnPlayerCommandText(playerid, cmdtext[]) | |
| 15 | {
| |
| 16 | if (strcmp("/farol", cmdtext, true, 10) == 0)
| |
| 17 | - | #else |
| 17 | + | |
| 18 | new luz[MAX_VEHICLES]; | |
| 19 | new motor, farol, alarme, porta, capo, portamala, objetivo; | |
| 20 | - | #endif |
| 20 | + | |
| 21 | if(carro != INVALID_VEHICLE_ID) | |
| 22 | {
| |
| 23 | if(luz[playerid] == 0) | |
| 24 | {
| |
| 25 | GetVehicleParamsEx(carro, motor, farol, alarme, porta, capo, portamala, objetivo); | |
| 26 | - | new luz[MAX_PLAYERS]; |
| 26 | + | |
| 27 | luz[playerid] = 1; | |
| 28 | SendClientMessage(playerid, -1, "Farol do veiculo Ligado."); | |
| 29 | } | |
| 30 | else if(luz[playerid] == 1) | |
| 31 | {
| |
| 32 | GetVehicleParamsEx(carro, motor, farol, alarme, porta, capo, portamala, objetivo); | |
| 33 | SetVehicleParamsEx(carro, motor, VEHICLE_PARAMS_OFF, alarme, porta, capo, portamala, objetivo); | |
| 34 | luz[playerid] = 0; | |
| 35 | SendClientMessage(playerid, -1, "Farol do veiculo Desligado."); | |
| 36 | } | |
| 37 | } | |
| 38 | } | |
| 39 | if (strcmp("/motor", cmdtext, true, 10) == 0)
| |
| 40 | {
| |
| 41 | new enginicao[MAX_VEHICLES]; | |
| 42 | new motor, farol, alarme, portas, capo, portamalas, objetivo; | |
| 43 | new carro = GetPlayerVehicleID(playerid); | |
| 44 | if(carro != INVALID_VEHICLE_ID) | |
| 45 | {
| |
| 46 | if(enginicao[playerid] == 0) | |
| 47 | {
| |
| 48 | GetVehicleParamsEx(carro, motor, farol, alarme, portas, capo, portamalas, objetivo); | |
| 49 | - | new enginicao[MAX_PLAYERS]; |
| 49 | + | |
| 50 | enginicao[playerid] = 1; | |
| 51 | SendClientMessage(playerid, -1, "Motor do veiculo Ligado."); | |
| 52 | } | |
| 53 | else if(enginicao[playerid] == 1) | |
| 54 | {
| |
| 55 | GetVehicleParamsEx(carro, motor, farol, alarme, portas, capo, portamalas, objetivo); | |
| 56 | SetVehicleParamsEx(carro, VEHICLE_PARAMS_OFF, farol, alarme, portas, capo, portamalas, objetivo); | |
| 57 | enginicao[playerid] = 0; | |
| 58 | SendClientMessage(playerid, -1, "Motor do veiculo Desligado."); | |
| 59 | } | |
| 60 | } | |
| 61 | } | |
| 62 | if (strcmp("/repararcarro", cmdtext, true) == 0)
| |
| 63 | {
| |
| 64 | if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage (playerid, 0x00FF00AA, "Você não está em um veiculo."); | |
| 65 | {
| |
| 66 | new veiculo = GetPlayerVehicleID (playerid); | |
| 67 | SetVehicleHealth (veiculo, 1000.0); | |
| 68 | SendClientMessage (playerid, -1, "O motor do veículo foi totalmente consertado."); | |
| 69 | return 1; | |
| 70 | } | |
| 71 | } | |
| 72 | - | new vehicleid = GetPlayerVehicleID (playerid); |
| 72 | + | return 0; |
| 73 | - | SetVehicleHealth (vehicleid, 1000.0); |
| 73 | + | |
| 74 | - | SendClientMessage (playerid, -1, "O motor do veículo foi totalmente reparado."); |
| 74 | + | |
| 75 | - | return 1; |
| 75 | + | /*----------------------------------------------------------------------------*/ |
| 76 | public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) | |
| 77 | - | return 1; |
| 77 | + | |
| 78 | SendClientMessage(playerid, 0xFFFFFFFF, "Ligar ou desligar a Luz do veiculo precione [Y] e motor [N]."); | |
| 79 | new motor, farol, alarme, portas, capo, portamalas, objetivo; | |
| 80 | {
| |
| 81 | GetVehicleParamsEx(vehicleid, motor, farol, alarme, portas, capo, portamalas, objetivo); | |
| 82 | - | new mensagem[128]; |
| 82 | + | SetVehicleParamsEx(vehicleid, motor, farol, alarme, portas, capo, portamalas, objetivo); |
| 83 | - | format(mensagem, sizeof (mensagem), "Ligar ou desligar a Luz do veiculo precione [Y] e motor [N]."); |
| 83 | + | |
| 84 | - | SendClientMessage(playerid, 0xFFFFFFFF, mensagem); |
| 84 | + | |
| 85 | } | |
| 86 | - | {
|
| 86 | + | |
| 87 | - | GetVehicleParamsEx(vehicleid, motor, farol, alarme, portas, capo, portamalas, objetivo); |
| 87 | + | /*----------------------------------------------------------------------------*/ |
| 88 | - | SetVehicleParamsEx(vehicleid, motor, farol, alarme, portas, capo, portamalas, objetivo); |
| 88 | + | |
| 89 | {
| |
| 90 | SendClientMessage(playerid, 0xFFFFFFFF, "Desligue o motor do veiculo, poupe seu combustivel!"); | |
| 91 | return 1; | |
| 92 | } | |
| 93 | ||
| 94 | /*----------------------------------------------------------------------------*/ | |
| 95 | - | new mensagem[128]; |
| 95 | + | |
| 96 | - | format(mensagem, sizeof (mensagem), "Desligue o motor do veiculo, poupe seu combustivel!"); |
| 96 | + | |
| 97 | - | SendClientMessage(playerid, 0xFFFFFFFF, mensagem); |
| 97 | + | |
| 98 | {
| |
| 99 | OnPlayerCommandText(playerid, "/farol"); | |
| 100 | return 1; | |
| 101 | } | |
| 102 | if((newkeys == 131072) && (IsPlayerInAnyVehicle(playerid))) | |
| 103 | {
| |
| 104 | OnPlayerCommandText(playerid, "/motor"); | |
| 105 | return 1; | |
| 106 | } | |
| 107 | return 1; | |
| 108 | } |