SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 17/06/2020, 01:01 PM   #1
ThiagoiHarDz
Banned
 
Join Date: May 2020
Location: Macarani-BA
Posts: 101
Reputation: 0
Default Dialog

Olá fiz uma tela login para android mas agora não consigo com que o player selecione por exemplo site mostre o site e quando ele clicar em fechar voltar pra tela de login

Code:
case DIALOG_PROXIMOANDROID:
        {
            ShowPlayerDialog(playerid, DIALOG_TELAANDROID, DIALOG_STYLE_MSGBOX, "", gs_Buffer, "Fechar", "");
            return true;
        }

	//aki é da tela de login android pra selecionar o discord case 2:
		        {
              		format(gs_Buffer, 120, "{FFFFFF}Brasil Play Fox\n\n");
					strcat(gs_Buffer, "\n{FF0000}Nosso Discord: https://discord.gg/wkAKqxx \n");
		   	 		ShowPlayerDialog(playerid, DIALOG_PROXIMOANDROID, DIALOG_STYLE_MSGBOX, "\t{FFFFFF}Brasil {FF0000}Play {FFFFFF}Fox - Discord", gs_Buffer, "Fechar", "");
		        }
ThiagoiHarDz is offline   Reply With Quote
Old 17/06/2020, 01:47 PM   #2
darkxdll
High-roller
 
darkxdll's Avatar
 
Join Date: Jul 2012
Location: C:\Windows\DLLs
Posts: 1,633
Reputation: 89
Default Re: Dialog

Dentro de OnDialogResponse, usa-se "response" para ver qual botão foi pressionado, esquerdo ou direito,

PHP Code:

if(response == 1)// 1 para botão esquerdo
if(response == 0)// 0 para botão direito 
A lógica é simples, apertou no botão direito, que seria o botão de 'voltar', você exibe denovo o dialog de login.
PHP Code:
if(response == 0)
{
ShowPlayerDialog(...parametros...);

__________________
Discord: darkxdll#9097

Consulte valores.
darkxdll is offline   Reply With Quote
Old 17/06/2020, 02:48 PM   #3
ThiagoiHarDz
Banned
 
Join Date: May 2020
Location: Macarani-BA
Posts: 101
Reputation: 0
Default Re: Dialog

Já tentei mas não funciona o dialog aparece quando eu clico em fechar ele não volta pra tela de login
ThiagoiHarDz is offline   Reply With Quote
Old 17/06/2020, 04:45 PM   #4
ThiagoiHarDz
Banned
 
Join Date: May 2020
Location: Macarani-BA
Posts: 101
Reputation: 0
Default Re: Dialog

@UP Alguém?
ThiagoiHarDz is offline   Reply With Quote
Old 17/06/2020, 07:24 PM   #5
MateGPlay
Big Clucker
 
MateGPlay's Avatar
 
Join Date: Jan 2018
Location: Florianópolis, Santa Catarina
Posts: 124
Reputation: 1
Default Re: Dialog

Usa como Exemplo:
PHP Code:
#define DIALOG_LOGIN 1 //define o id da sua dialog no topo da gm

ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"Login""Digite Sua Senha para Efetuar o Login""Confirmar""Cancelar"); //função para exibir a dialog que devera usar

public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid)
    {
        case 
DIALOG_LOGIN:
        {
            if(!
response)
                return 
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"Login""Digite Sua Senha para Efetuar o Login\nVocê Deve Inserir uma Senha""Confirmar""Cancelar"); // caso não responda a dialog retorna a dialog novamente.
        
}
    }
    return 
1;

MateGPlay is offline   Reply With Quote
Old 17/06/2020, 07:33 PM   #6
ThiagoiHarDz
Banned
 
Join Date: May 2020
Location: Macarani-BA
Posts: 101
Reputation: 0
Default Re: Dialog

Quote:
Originally Posted by MateGPlay View Post
Usa como Exemplo:
PHP Code:
#define DIALOG_LOGIN 1 //define o id da sua dialog no topo da gm

ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"Login""Digite Sua Senha para Efetuar o Login""Confirmar""Cancelar"); //função para exibir a dialog que devera usar

public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid)
    {
        case 
DIALOG_LOGIN:
        {
            if(!
response)
                return 
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"Login""Digite Sua Senha para Efetuar o Login\nVocê Deve Inserir uma Senha""Confirmar""Cancelar"); // caso não responda a dialog retorna a dialog novamente.
        
}
    }
    return 
1;


Queria que por exemplo ele clicasse em discord aparecesse um dialog com o discord do servidor e quando ele clicar em fechar voltar pra tela de login
ThiagoiHarDz is offline   Reply With Quote
Old 17/06/2020, 07:54 PM   #7
MateGPlay
Big Clucker
 
MateGPlay's Avatar
 
Join Date: Jan 2018
Location: Florianópolis, Santa Catarina
Posts: 124
Reputation: 1
Default Re: Dialog

Quote:
Originally Posted by ThiagoiHarDz View Post
Queria que por exemplo ele clicasse em discord aparecesse um dialog com o discord do servidor e quando ele clicar em fechar voltar pra tela de login
PHP Code:
#define DIALOG_LOGIN 1
#define DIALOG_DISCORD 2

ShowPlayerDialog(playeridDIALOG_DISCORDDIALOG_STYLE_MSGBOX"Discord""https://discord.gg/wkAKqxx""Fechar""");

public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid)
    {
        case 
DIALOG_LOGIN:
        {
            if(!
response)
                return 
ShowPlayerDialog(playeridDIALOG_DISCORDDIALOG_STYLE_MSGBOX"Discord""https://discord.gg/wkAKqxx""Fechar"""); 
            if(!
strlen(inputtext))
                return 
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"Login""Digite Sua Senha para Efetuar o Login\nVocê Deve Inserir uma Senha""Confirmar""Discord");
        }
        case 
DIALOG_DISCORDShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"Login""Digite Sua Senha para Efetuar o Login""Confirmar""Discord");
    }
    return 
1;

MateGPlay is offline   Reply With Quote
Old 17/06/2020, 08:07 PM   #8
ThiagoiHarDz
Banned
 
Join Date: May 2020
Location: Macarani-BA
Posts: 101
Reputation: 0
Default Re: Dialog

É... eu falei tela de login assim na tela de login fica
Login
Site
Discord
Creditos
Novidades
Sair
ThiagoiHarDz is offline   Reply With Quote
Old 17/06/2020, 08:15 PM   #9
darkxdll
High-roller
 
darkxdll's Avatar
 
Join Date: Jul 2012
Location: C:\Windows\DLLs
Posts: 1,633
Reputation: 89
Default Re: Dialog

Jovem,

PHP Code:
// vai precisar de DIALOG_STYLE_LIST
#define DIALOG_INICIAL 1001
ShowPlayerDialog(playeridDIALOG_INICIAL,DIALOG_STYLE_LIST,"Titulo","Item1 \n Item2 \n Item3 \n Item4""Ok","Sair");

//ondialogresponse

if(listitem == 0
{
//funcoes item 1
}else if(listitem == 1)
{
//funcoes item 2

Ai tu mostra dialog de msgbox pro player, ai tu cria o response desta nova dialog.
__________________
Discord: darkxdll#9097

Consulte valores.
darkxdll is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CLEO - Automatically select from DIALOG, when DIALOG is opened, and click the first button. AlaDyn172 Scripting Help 0 05/12/2019 01:43 AM
[DIALOG]How i Create A dialog Whent Player Login To Enter in Dialog The Password donhu789 Scripting Help 8 29/09/2013 07:15 AM
Warning: PlayerDialogResponse PlayerId: 0 dialog ID doesn't match last sent dialog ID Blackazur Scripting Help 1 30/04/2013 06:25 PM
[19:58:45] Warning: PlayerDialogResponse PlayerId: 28 dialog ID doesn't match last sent dialog ID, what it means? niels44 Scripting Help 6 13/06/2012 05:53 PM
Big problem (PlayerDialogResponse PlayerId: 57 dialog ID doesn't match last sent dialog ID) RingoRus Server Support 3 12/06/2012 05:54 PM


All times are GMT. The time now is 07:25 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.