else if(playertextid == PreguntaR[playerid])
{
ShowPlayerDialog(playerid, DIALOG_PREGUNTAS, DIALOG_STYLE_LIST, "Seleccione una pregunta de seguridad", "1) Mi mejor amigo\n2) Nombre de mi mamб\n3) Nombre de mi papб\n4) Nъmero de documento\n5) Mi primera mascota\n6) Otro ...", "Aceptar","Cancelar");
}
//==========================
case DIALOG_PREGUNTAS:
{
if(response == 1)
{
new Str1[106], Str2[154];
switch(listitem)
{
case 0:
{
alm(Info[playerid][pPreguntaS], "Mi mejor amigo");
format(Str1, sizeof(Str1), "~r~%d", Info[playerid][pPreguntaS]);
PlayerTextDrawSetString(playerid, PreguntaR[playerid], Str1);
format(Str2, sizeof(Str2), "Ahora escribe la respuesta secreta a la pregunta: %s", Info[playerid][pPreguntaS]);
ShowPlayerDialog(playerid, DIALOG_RESPUESTA, DIALOG_STYLE_INPUT, "Respuesta de seguridad", Str2, "Continuar","Cancelar");
}
case 1:
{
alm(Info[playerid][pPreguntaS], "Nombre de mi mamб");
format(Str1, sizeof(Str1), "~r~%d", Info[playerid][pPreguntaS]);
PlayerTextDrawSetString(playerid, PreguntaR[playerid], Str1);
format(Str2, sizeof(Str2), "Ahora escribe la respuesta secreta a la pregunta: %s", Info[playerid][pPreguntaS]);
ShowPlayerDialog(playerid, DIALOG_RESPUESTA, DIALOG_STYLE_INPUT, "Respuesta de seguridad", Str2, "Continuar","Cancelar");
}
case 2:
{
alm(Info[playerid][pPreguntaS], "Nombre de mi papб");
format(Str1, sizeof(Str1), "~r~%d", Info[playerid][pPreguntaS]);
PlayerTextDrawSetString(playerid, PreguntaR[playerid], Str1);
format(Str2, sizeof(Str2), "Ahora escribe la respuesta secreta a la pregunta: %s", Info[playerid][pPreguntaS]);
ShowPlayerDialog(playerid, DIALOG_RESPUESTA, DIALOG_STYLE_INPUT, "Respuesta de seguridad", Str2, "Continuar","Cancelar");
}
case 3:
{
alm(Info[playerid][pPreguntaS], "Nъmero de documento");
format(Str1, sizeof(Str1), "~r~%d", Info[playerid][pPreguntaS]);
PlayerTextDrawSetString(playerid, PreguntaR[playerid], Str1);
format(Str2, sizeof(Str2), "Ahora escribe la respuesta secreta a la pregunta: %s", Info[playerid][pPreguntaS]);
ShowPlayerDialog(playerid, DIALOG_RESPUESTA, DIALOG_STYLE_INPUT, "Respuesta de seguridad", Str2, "Continuar","Cancelar");
}
case 4:
{
alm(Info[playerid][pPreguntaS], "Mi primera mascota");
format(Str1, sizeof(Str1), "~r~%d", Info[playerid][pPreguntaS]);
PlayerTextDrawSetString(playerid, PreguntaR[playerid], Str1);
format(Str2, sizeof(Str2), "Ahora escribe la respuesta secreta a la pregunta: %s", Info[playerid][pPreguntaS]);
ShowPlayerDialog(playerid, DIALOG_RESPUESTA, DIALOG_STYLE_INPUT, "Respuesta de seguridad", Str2, "Continuar","Cancelar");
}
case 5:
{
ShowPlayerDialog(playerid, DIALOG_OTRAP, DIALOG_STYLE_INPUT, "Pregunta de seguridad", "Escribe la pregunta de seguridad que desees:", "Aceptar","Cancelar");
return 1;
}
}
}
}
//-----------
case DIALOG_OTRAP:
{
if (!response)
{
fremove(UserPath(playerid));
Kick(playerid);
}
else
{
if (!(2 <= strlen(inputtext) < MAX_CARACTERES_PS)) return ShowPlayerDialog(playerid, DIALOG_OTRAP, DIALOG_STYLE_INPUT, "Registro - ERROR", "La pregunta puede contener desde 2 hasta "#MAX_CARACTERES_PS" caracteres.\nEscribe la pregunta nuevamente:", "Continuar","Salir");
alm(Info[playerid][pPreguntaS], inputtext);
new Str1[106], Str2[154];
format(Str1, sizeof(Str1), "~r~%d", Info[playerid][pRespuestaS]);// їNo seria la variable Info[playerid][pPreguntaS] que tiene que ir y usando %s?
PlayerTextDrawSetString(playerid, RespuestaR[playerid], Str1);// їRespuestaR[playerid] reemplazado por PreguntaR[playerid]?
format(Str2, sizeof(Str2), "Ahora escribe la respuesta secreta a la pregunta: %s", Info[playerid][pPreguntaS]);
ShowPlayerDialog(playerid, DIALOG_RESPUESTA, DIALOG_STYLE_INPUT, "Respuesta de seguridad", Str2, "Continuar", "Cancelar");
}
}
//---------------
case DIALOG_RESPUESTA:
{
if (!response)
{
fremove(UserPath(playerid));
Kick(playerid);
}
else
{
if (!(2 <= strlen(inputtext) < MAX_CARACTERES_RS)) return ShowPlayerDialog(playerid, DIALOG_RESPUESTA, DIALOG_STYLE_INPUT, "Registro - ERROR","La respuesta puede contener desde 2 hasta "#MAX_CARACTERES_RS" caracteres.\nEscribe la respuesta nuevamente:", "Continuar","Salir");
alm(Info[playerid][pRespuestaS], inputtext);
new INI:File = INI_Open(UserPath(playerid)), Ip[16];
GetPlayerIp(playerid, Ip, 16);
INI_SetTag(File, "data");
INI_WriteString(File, "Pregunta_de_seguridad", Info[playerid][pPreguntaS]);
INI_WriteInt(File, "Respuesta_de_seguridad", Info[playerid][pRespuestaS]);// їNo seria INI_WriteString?
INI_WriteString(File, "IP", Ip);
INI_Close(File);
new Str1[106];
format(Str1, sizeof(Str1), "~r~%d", Info[playerid][pRespuestaS]);
PlayerTextDrawSetString(playerid, RespuestaR[playerid], Str1);
SendClientMessageEx(playerid, -1, "Pregunta con respuesta terminado.");
}
}
ShowPlayerDialog(playerid, DIALOG_RESPUESTA, DIALOG_STYLE_INPUT, "Respuesta de seguridad", Str2, "Continuar","Cancelar");
ShowPlayerDialog(playerid, DIALOG_OTRAP, DIALOG_STYLE_INPUT, "Pregunta de seguridad", "Escribe la pregunta de seguridad que desees:", "Aceptar","Cancelar");
else if(playertextid == PreguntaR[playerid])
{
ShowPlayerDialog(playerid, DIALOG_RESPUESTA, DIALOG_STYLE_INPUT, "Respuesta de seguridad", Str2, "Continuar","Cancelar");
}
case DIALOG_PREGUNTAS:
{
if(response == 1)
{
new Str1[106], Str2[154];
switch(listitem)
{
case 0:
{
alm(Info[playerid][pPreguntaS], "Mi mejor amigo");
format(Str1, sizeof(Str1), "~r~%d", Info[playerid][pPreguntaS]);
PlayerTextDrawSetString(playerid, PreguntaR[playerid], Str1);
format(Str2, sizeof(Str2), "Ahora escribe la respuesta secreta a la pregunta: %s", Info[playerid][pPreguntaS]);
ShowPlayerDialog(playerid, DIALOG_RESPUESTA, DIALOG_STYLE_INPUT, "Respuesta de seguridad", Str2, "Continuar","Cancelar");
}
case 1:
{
alm(Info[playerid][pPreguntaS], "Nombre de mi mamб");
format(Str1, sizeof(Str1), "~r~%d", Info[playerid][pPreguntaS]);
PlayerTextDrawSetString(playerid, PreguntaR[playerid], Str1);
format(Str2, sizeof(Str2), "Ahora escribe la respuesta secreta a la pregunta: %s", Info[playerid][pPreguntaS]);
ShowPlayerDialog(playerid, DIALOG_RESPUESTA, DIALOG_STYLE_INPUT, "Respuesta de seguridad", Str2, "Continuar","Cancelar");
}
case 2:
{
alm(Info[playerid][pPreguntaS], "Nombre de mi papб");
format(Str1, sizeof(Str1), "~r~%d", Info[playerid][pPreguntaS]);
PlayerTextDrawSetString(playerid, PreguntaR[playerid], Str1);
format(Str2, sizeof(Str2), "Ahora escribe la respuesta secreta a la pregunta: %s", Info[playerid][pPreguntaS]);
ShowPlayerDialog(playerid, DIALOG_RESPUESTA, DIALOG_STYLE_INPUT, "Respuesta de seguridad", Str2, "Continuar","Cancelar");
}
case 3:
{
alm(Info[playerid][pPreguntaS], "Nъmero de documento");
format(Str1, sizeof(Str1), "~r~%d", Info[playerid][pPreguntaS]);
PlayerTextDrawSetString(playerid, PreguntaR[playerid], Str1);
format(Str2, sizeof(Str2), "Ahora escribe la respuesta secreta a la pregunta: %s", Info[playerid][pPreguntaS]);
ShowPlayerDialog(playerid, DIALOG_RESPUESTA, DIALOG_STYLE_INPUT, "Respuesta de seguridad", Str2, "Continuar","Cancelar");
}
case 4:
{
alm(Info[playerid][pPreguntaS], "Mi primera mascota");
format(Str1, sizeof(Str1), "~r~%d", Info[playerid][pPreguntaS]);
PlayerTextDrawSetString(playerid, PreguntaR[playerid], Str1);
format(Str2, sizeof(Str2), "Ahora escribe la respuesta secreta a la pregunta: %s", Info[playerid][pPreguntaS]);
ShowPlayerDialog(playerid, DIALOG_RESPUESTA, DIALOG_STYLE_INPUT, "Respuesta de seguridad", Str2, "Continuar","Cancelar");
}
case 5:
{
ShowPlayerDialog(playerid, DIALOG_OTRAP, DIALOG_STYLE_INPUT, "Pregunta de seguridad", "Escribe la pregunta de seguridad que desees:", "Aceptar","Cancelar");
return 1;
}
}
}
}
|
If you mean the dialog wont show or doesn't return a response make sure that you: 1- Return 0; at the end on the last of OnDialogueResponse on all of your scripts 2- Don't have 2 dialogs with the same id, you cant have #define DIALOG_SKINS 250 and #define DIALOG_WEAPONS 250 < that wont work. |