One dialog after another
#1

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);
  }
}
Reply
#2

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!");
}
}
Reply
#3

You didn't understand. After the first dialog(dialog_PKFILEA) the second one doesn't appear.
Reply
#4

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);
  }
}
Reply
#5

Still,nothing happens after i type the name
Reply
#6

try putting the "EDIT2" I updated
Reply
#7

nop,doesn't work
Reply
#8

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!
Reply
#9

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
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)