[Ajuda] Mudar Este Comando de Ligar Veiculo
#1

Tava mexendo em alguns GM base e tava querendo mudar a tecla Y para ligar o veiculo.

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(Engine[vehicleid] == 0)
        {
        Controle(playerid, 0);
        SendClientMessage(playerid, 0xFF6A08AA, "{FFFFFF}[BLM]{00FF00} Pressione a tecla {FFEA00}[Shift] {FFFFFF}para ligar o seu veiculo");
        }
    }
Reply
#2

Vocк precisara ir na callback OnPlayerKeyStateChange e alterar para tecla desejada , aqui esta todas as keys podem ser utilizadas no sa:mp
Reply
#3

Entendi, muito obrigado
Reply
#4

Eu coloquei a tecla Y mas no jogo o personagem simplismete sai do veiculo, veja se tem alguma coisa errada?

pawn Код:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
        new vehicleid = GetPlayerVehicleID(playerid);
        if(IsPlayerInAnyVehicle(playerid))
        {
        if(Engine[vehicleid] == 0)
            {
                if(newkeys & KEY_YES)
                    {
                    RemovePlayerFromVehicle(playerid);
                    Controle(playerid, 1);
                    }
                else if(newkeys & KEY_YES)
                    {
                    SendClientMessage(playerid, COLOR_GREEN, "Ligando veiculo...");
                    SetTimerEx("EngineTimer", 1000, 0, "i", playerid);
                    }
            }
    }
Reply
#5

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    new 
vehicleid GetPlayerVehicleID(playerid);
    new 
enginelightsalarmdoorsbonnetbootobjective;
    if(
IsPlayerInAnyVehicle(playerid))
    {
        if(
Engine[vehicleid] == 0)
        {
            
GetVehicleParamsEx(vehicleidenginelightsalarmdoorsbonnetbootobjective);
            if(
newkeys KEY_YES)
            {
                
SetVehicleParamsEx(vehicleidfalselightsfalsedoorsbonnetbootobjective);
                
RemovePlayerFromVehicle(playerid);
            }
            else if(
newkeys KEY_YES)
            {
                
SendClientMessage(playeridCOLOR_GREEN"Ligando veiculo...");
                
SetVehicleParamsEx(vehicleidtruelightsfalsedoorsbonnetbootobjective);
            }
        }
    }
    return 
1;

Reply
#6

Substituindo seu comando pelo o meu, Pawn Compiler Library para de funcionar wtf
Reply
#7

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    new 
vehicleid GetPlayerVehicleID(playerid);
    new 
enginelightsalarmdoorsbonnetbootobjective;
    if(
IsPlayerInAnyVehicle(playerid))
    {
        if(
newkeys KEY_YES)
        {
            
GetVehicleParamsEx(vehicleidenginelightsalarmdoorsbonnetbootobjective);
            if(
Engine[vehicleid] == 1)
            {
                
SetVehicleParamsEx(vehicleidfalselightsfalsedoorsbonnetbootobjective);
                
Engine[vehicleid] = 0;
                
RemovePlayerFromVehicle(playerid);
            }
            else if(
Engine[vehicleid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREEN"Ligando veiculo...");
                
SetVehicleParamsEx(vehicleidtruelightsfalsedoorsbonnetbootobjective);
                
Engine[vehicleid] = 1;
            }
        }
    }
    return 
1;

Reply
#8

Obrigado vocк foi de grande ajuda.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)