One dialog after another -
dusk - 06.03.2013
I'm trying to make a system for cops. It's for personal files. And the problem occured in write section. If the cop chooses to add more data,it should show a dialog in which he should write a name, and then another dialog in which is what he wants to write. Tried improvising,didn't work.This is what i got:
pawn Код:
if(dialogid==DIALOG_PFILEA && response)
{
new vardas=strval(inputtext),string[128];
format(string,sizeof(string),"%s byla",vardas);
ShowPlayerDialog(playerid,DIALOG_PFILECRIME,DIALOG_STYLE_INPUT,"Asmens bylos pildymas",string","Saugoti","Atрaukti");
if(dialogid==DIALOG_PFILECRIME && response)
{
new string[128],query[128];
GetPlayerName(playerid,Name,sizeof(Name));
format(string,sizeof(string),"%s. Бraрл:%s",inputtext,Name);
format(query,sizeof(query),"UPDATE `PoliceFiles` SET Nusikaltimai = '%s' WHERE Vardas = '%s'",string,vardas);
}
}
Re: One dialog after another -
Scrillex - 06.03.2013
pawn Код:
if(dialogid==DIALOG_PFILEA && response)
{
new vardas=strval(inputtext),string[128];
format(string,sizeof(string),"%s byla",vardas);
ShowPlayerDialog(playerid,DIALOG_PFILECRIME,DIALOG_STYLE_INPUT,"Asmens bylos pildymas",string","Saugoti","Atрaukti");
if(dialogid==DIALOG_PFILECRIME && response)
{
new string[128],query[128];
GetPlayerName(playerid,Name,sizeof(Name));
format(string,sizeof(string),"%s. Бraрл:%s",inputtext,Name);
format(query,sizeof(query),"UPDATE `PoliceFiles` SET Nusikaltimai = '%s' WHERE Vardas = '%s'",string,vardas);
ShowPlayerDialog(playerid,DIALOG_YOUR,DIALOG_MSGBOX,"something","something","ok","NO!");
}
}
Re: One dialog after another -
dusk - 06.03.2013
You didn't understand. After the first dialog(dialog_PKFILEA) the second one doesn't appear.
Re: One dialog after another -
L.Hudson - 06.03.2013
EDIT2: try this...
pawn Код:
if(dialogid==DIALOG_PFILEA && response)
{
new vardas=strval(inputtext),string[128];
format(string,sizeof(string),"%s byla",vardas);
ShowPlayerDialog(playerid,DIALOG_PFILECRIME,DIALOG_STYLE_INPUT,"Asmens bylos pildymas",string,"Saugoti","Atрaukti");
if(dialogid==DIALOG_PFILECRIME && response)
{
new string[128],query[128];
GetPlayerName(playerid,Name,sizeof(Name));
format(string,sizeof(string),"%s. Бraрл:%s",inputtext,Name);
format(query,sizeof(query),"UPDATE `PoliceFiles` SET Nusikaltimai = '%s' WHERE Vardas = '%s'",string,vardas);
}
}
Re: One dialog after another -
dusk - 06.03.2013
Still,nothing happens after i type the name
Re: One dialog after another -
L.Hudson - 06.03.2013
try putting the "EDIT2" I updated
Re: One dialog after another -
dusk - 06.03.2013
nop,doesn't work
Re: One dialog after another -
mamorunl - 06.03.2013
Lets go through this code line for line.
pawn Код:
if(dialogid==DIALOG_PFILEA && response) // nothing wrong with this, just checks if the dialog is DIALOG_PFILEA and the response is true
{
new vardas=strval(inputtext),string[128]; // vardas will be an integer value
format(string,sizeof(string),"%s byla",vardas); // you are now trying to put the integer as a string inside of another string
ShowPlayerDialog(playerid,DIALOG_PFILECRIME,DIALOG_STYLE_INPUT,"Asmens bylos pildymas",string,"Saugoti","Atрaukti"); // show the dialog
if(dialogid==DIALOG_PFILECRIME && response) // this piece of code will never get run. This should be at (look at <<INS)
{
new string[128],query[128];
GetPlayerName(playerid,Name,sizeof(Name));
format(string,sizeof(string),"%s. Бraрл:%s",inputtext,Name);
format(query,sizeof(query),"UPDATE `PoliceFiles` SET Nusikaltimai = '%s' WHERE Vardas = '%s'",string,vardas);
// nothing wrong from what I can see, other than I have no idea what the text is actually saying xD
// also, nothing gets run, maybe that is chosen at this point, otherwise it is useless code
}
}
// <<INS
I hope that will make some sense and you'll learn from that

If you fix these issues, the second dialog may pop up!
Re: One dialog after another -
dusk - 06.03.2013
pawn Код:
if(dialogid==DIALOG_PFILEA && response)
{
new string1[128];
format(string1,sizeof(string1),"%s",inputtext);
ShowPlayerDialog(playerid,DIALOG_PFILECRIME,DIALOG_STYLE_INPUT,"Asmens bylos pildymas",string1,"Saugoti","At?aukti");
}
if(dialogid==DIALOG_PFILECRIME && response)
{
new string[128],query[128];
GetPlayerName(playerid,Name,sizeof(Name));
format(string,sizeof(string),"%s. A'ra?e%s",inputtext,Name);
format(query,sizeof(query),"UPDATE `PoliceFiles` SET Nusikaltimai = '%s' WHERE Vardas = '%s'",string,string1);
}
Whats INS? And still,the second dialog just doesn't appear
Re: One dialog after another -
mamorunl - 06.03.2013
INS is the place where you have to put your whole IF statement. At the place where I commented <<INS.
For as why it doesn't show, from the code that I see, there is nothing really wrong with this code.