Portal SAMP
[Ajuda] Retornar em uma dialog - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=6)
+--- Tópico: [Ajuda] Retornar em uma dialog (/showthread.php?tid=660)



Retornar em uma dialog - GuiLopeS - 17/01/2021

Olá eu queria saber como faz para voltar em uma dialog como por exemplo:

O player seleciona uma das alternativas abaixo:
Código:
CMD:gps(playerid){

    ShowPlayerDialog(playerid, GPS, DIALOG_STYLE_LIST, "{009059}GPS - Servidor {FFFFFF}BRT ®", "{CCCCCC}Locais Diversos\nLocais das profissões\n{FF0000}Desligar GPS", "Selecionar", "Sair");
    return 1;
}
E aparece essas:
Código:
if(dialogid == GPS)
    {
        if(response)
        {
            if(listitem == 0)
            {
                ShowPlayerDialog(playerid, GPSL, DIALOG_STYLE_LIST, "{CCCCCC}Locais Diversos:", "{3366FF}Local para tirar licenças\n{3366FF}Prefeitura\n{3366FF}Base principal do servidor\n{3366FF}Departamento da Polícia", "Selecionar", "Sair");
            }
            else if(listitem == 1)
            {
                ShowPlayerDialog(playerid, GPSP, DIALOG_STYLE_LIST, "{CCCCCC}Locais das profissões:", "{FF6600}Transportes\n{00C900}Honestas\n{FB0000}Mafia\n{E6E6E6}Governo", "Selecionar", "Sair");
            }
            else if(listitem == 2)
            {
                RemovePlayerMapIcon(playerid, 69);
                SendClientMessage(playerid, -1, "{FF0000}!GPS Desligado!");
            }
        }
    }

Eu quero saber como retorno ou "volto" essa segunda lista para a primeira sem sair e digitar o comando "/gps" de novo, se alguem puder ajudar agradeço!

Att: GuiLopeS


RE: Retornar em uma dialog - guikommander2 - 17/01/2021

Código PHP:
#define DIALOG_GPS 2032

CMD:gps(playerid)
{
    
ShowPlayerDialogEx(playeridDIALOG_GPS);
    return 
1;
}

stock ShowPlayerDialogEx(playeriddialogid)
{
    if(
dialogid == DIALOG_GPS)
    {
        
ShowPlayerDialog(....
    }
    
    if(
dialogid == D_LOCAIS)
    {
        
ShowPlayerDialog(....
    }
}

public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOG_GPS)
    {
        if(
response)
        {
            if(
listitem == 0ShowPlayerDialogEx(playeridD_LOCAIS);
        }
    }
    
    if(
dialogid == D_LOCAIS)
    {
        if(
response)
        {
        }
        else
        {
            
// vai voltar ao gps..
            
ShowPlayerDialogEx(playeridDIALOG_GPS);
        }
    }

    return 
1;




RE: Retornar em uma dialog - Smyle - 17/01/2021

Só você mostrar a Dialog Box novamente quando o player sair dos Dialogs secundários.

Ex:
Código:
if(dialogid == GPSL) {
  if(!response) return ShowPlayerDialog(playerid, GPS, DIALOG_STYLE_LIST, "{009059}GPS - Servidor {FFFFFF}BRT ®", "{CCCCCC}Locais Diversos\nLocais das profissões\n{FF0000}Desligar GPS", "Selecionar", "Sair");
  // restante do codigo aq
}
if(dialogid == GPSP) {
  if(!response) return ShowPlayerDialog(playerid, GPS, DIALOG_STYLE_LIST, "{009059}GPS - Servidor {FFFFFF}BRT ®", "{CCCCCC}Locais Diversos\nLocais das profissões\n{FF0000}Desligar GPS", "Selecionar", "Sair");
  // restante do codigo aq
}