OnDialogResponse error
#1

Hello, i get no errors but nothing happens :S

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

	switch(dialogid)
	{
		// Login Box
		case 1: 
		{
			SendClientMessageToAll(0xC4C4C4FF, "HOLA");
			if(response)
			{
                                 SendClientMessageToAll(0xC4C4C4FF, "HOLA");
				// Conseguir Datos
				//SetUserInfo(playerid, inputtext);
				//if(!strcmp(inputtext, user[playerid][username], true))
				//	ShowPlayerDialog(playerid, dialogs[passbox], DIALOG_STYLE_PASSWORD, "{FF0000}Contrasenya", "Tu contrasenya:", "Conexion", "Salir");
			}
		
		}

		// Pass Box
		case 2:
		{
			if(response)
			{
				if(!strcmp(inputtext, user[playerid][userpass], true))
					ShowPlayerDialog(playerid, dialogs[logincorrect], DIALOG_STYLE_MSGBOX, "{FF0000}Conectado", "Se ha logueado satisfactoriamente.", "Entrar", "Salir");
				else
					SendClientMessageToAll(0xC4C4C4FF, "Contrasenya Mal!");
			}			
		}
	}
i get no text on screen by submiting dialog with ID 1 :S
Reply
#2

1) You can take a look at the wiki first.
https://sampwiki.blast.hk/wiki/OnDialogResponse

2) Now, here's the problem. When it says case 1: or case 2: They don't know what dialog you are doing so you're going to either use
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOGNAMEHERE)
    {
    //Stuff here.
    }
    return 1;
}
Or
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    case DIALOGNAMEHERE:
    {
        //Stuff here
    }
    return 1;
}
What you did wrong was that you never like did that which the server dosen't know what the dialog should it show.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)