SA-MP Forums Archive
[Ajuda] Sistema de Motor - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Sistema de Motor (/showthread.php?tid=569480)



Sistema de Motor - Italoigt - 31.03.2015

Galera Queria Ajuda De Vocкs,Issu e quase um PEDIDO eu estou com sistema de Motor Que Liga e Desliga Com (Y) Ai Eu queria Quando o carro Fica Perto De Pegar Fogo ele desliga se й nгo Liga se novamente sу quando um mecвnico chega se e arrumava
pawn Код:
if(newkeys == KEY_YES && IsPlayerInAnyVehicle(playerid))
    {
    new mot, lu, alar, por, cap, porma, ob;
    new carro = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
    if(mot == VEHICLE_PARAMS_OFF)
    {
    SetVehicleParamsEx(carro, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob);
    SendClientMessage(playerid, Verde, "Motor ligado");
    }else{
    SendClientMessage(playerid,Branco, "Motor Desligado");
    SetVehicleParamsEx(carro, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
    }
    }



Re: Sistema de Motor - ZeZin - 31.03.2015

GetVehicleHealth


Re: Sistema de Motor - Italoigt - 31.03.2015

Alguйm Nгo Tem Sugestхes?


Re: Sistema de Motor - ipsLuan - 31.03.2015

Quote:
Originally Posted by Italoigt
Посмотреть сообщение
Alguйm Nгo Tem Sugestхes?
Amigo, olha o cуdigo que o cara mandou acima.
Ao clicar lб, vocк tem o exemplo dado pela Wikipйdia do SA:MP.


Re: Sistema de Motor - ZeZin - 31.03.2015

Nгo sei se isso ira funcionar mais da pra entender um pouco.

pawn Код:
new float: estado;
new vei = GetPlayerVehicleID(playerid);
new mot, lu, alar, por, cap, porma, o

if (health < 40)//nгo sei se o estado correto de ponto a pifar
{
      GetVehicleParamsEx(vei, mot, lu, alar, por, cap, p, o);
            SetVehicleParamsEx(vei, false, lu, alar, por, cap, porma o);
            SendClientMessage(playerid,-1, "Estragou"!");
}



Re: Sistema de Motor - ipsLuan - 31.03.2015

Sу faltou a funзгo pra pegar o health do veнculo.
E, tambйm, nгo pule espaзo na criaзгo de variбveis booleanas.

PHP код:
GetVehicleHealth(veihealth); 



Re: Sistema de Motor - Italoigt - 31.03.2015

vo tentar se funfar Rep+