OnDialogResponse error - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnDialogResponse error (
/showthread.php?tid=407346)
OnDialogResponse error -
redigaffix - 13.01.2013
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
Re: OnDialogResponse error -
JustinAn - 13.01.2013
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.