[Ajuda] Erro Menu
#1

Eu fiz a profissгo Piloto no meu GM, quando digita /carregar no local de carga abre um menu para escolher o local da entrega, mas tem um problema, na primeira opзгo da tudo certo, mas se escolher o segundo aparece "Vocк jб esta com Carga", mesmo nгo tendo pego carga ainda, aqui o codigo:

pawn Код:
if (dialogid == EntregadeCarga) // Menu
    {
        if (response)
        {
            if (listitem == 0) // Local 1
            {
                SetPlayerCheckpoint(playerid,-1652.4418,-159.2875,13.8048,6.0);
                if(PegarCargaPiloto[playerid] == 0){
                SendClientMessage(playerid,COLOR_GREEN,"Aviгo Carregado!");
                SendClientMessage(playerid,COLOR_GREEN,"Para descarregar siga o ponto Vermelho no Mapa.");
                PegarCargaPiloto[playerid] = 1;
                return 1;
                }
                } else {
                SendClientMessage(playerid,Vermelho,"Seu aviгo jб esta carregado!");
                return 1;
                }
            if (listitem == 1) // Local 2
            {
                SetPlayerCheckpoint(playerid,1477.1531,1779.2961,10.4677,6.0);
                if(PegarCargaPiloto[playerid] == 0){
                SendClientMessage(playerid,COLOR_GREEN,"Aviгo Carregado!");
                SendClientMessage(playerid,COLOR_GREEN,"Para descarregar siga o ponto Vermelho no Mapa.");
                PegarCargaPiloto[playerid] = 1;
                return 1;
                }
                } else {
                SendClientMessage(playerid,Vermelho,"Seu aviгo jб esta carregado!");
                return 1;
                }
            }
            }
Reply
#2

pawn Код:
}
} else {
SendClientMessage(playerid,Vermelho,"Seu aviгo jб esta carregado!");
return 1;
}
Vocк colocou uma chave a mais, por isso sempre use a identaзгo.

pawn Код:
if (listitem == 0) // Local 1
{
    SetPlayerCheckpoint(playerid,-1652.4418,-159.2875,13.8048,6.0);
    if(PegarCargaPiloto[playerid] == 0)
    {
        SendClientMessage(playerid,COLOR_GREEN,"Aviгo Carregado!");
        SendClientMessage(playerid,COLOR_GREEN,"Para descarregar siga o ponto Vermelho no Mapa.");
        PegarCargaPiloto[playerid] = 1;
        return 1;
    }
    else
    {
        SendClientMessage(playerid,Vermelho,"Seu aviгo jб esta carregado!");
        return 1;
    }
}

if (listitem == 1) // Continue seu cуdigo daqui, re-idente o resto colocando como eu fiz ;)
{
   
}
   
                }
OBS: Colocando essa chave a mais, vocк fechou a chave do response, por isso estб tendo erros
Reply
#3

Ahhh entendi, eu tenho muitos problemas com chaves heuaheuheuhea, varios erros por causa delas
Reply
#4

Use o tab, assim seu cуdigo ficarб sempre identado

Se te ajudei da +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)