Using more than one dialog?
#1

Hello!

Код:
	if (strcmp("/test", cmdtext, true, 10) == 0)
	{
 		ShowPlayerDialog(playerid, 157, DIALOG_STYLE_LIST, "Service", "pah \npoh \npih", "Select", "Cancel");
		return 1;
		}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

	if(dialogid == 157 && response) 
  {
    switch(listitem)
    {
      case 0:
      {
			SendClientMessage(playerid,0xAA000AA,"text");
      }
      case 1:
      {
 			SendClientMessage(playerid,0xAA000AA,"text");
      }
      case 2:
      {
		  SendClientMessage(playerid,0xAA000AA,"text");
      }
    }
  }
	return 1;
}
I want to add another dialog, but If I do, it ends up with many errors.
I read from samp wiki that I have to use somekind of switch, but It wasnt explained there.
So how to?

Regards,
Assyria
Reply
#2

Anyone?
Reply
#3

what u mean with alot of errors i have more than 5 dialogs in my server and nothing happens , alot of errors probably means a missing Bracket
Reply
#4

Example
Dialog 1
Код:
ShowPlayerDialog(playerid, 157, DIALOG_STYLE_LIST, "Service", "pah \npoh \npih", "Select", "Cancel");
Dialog 2
Код:
ShowPlayerDialog(playerid, 158, DIALOG_STYLE_LIST, "Service", "pah \npoh \npih", "Select", "Cancel");
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

	if(dialogid == 158 && response) 
  {
    switch(listitem)
    {
      case 0:
      {
			SendClientMessage(playerid,0xAA000AA,"text");
      }
      case 1:
      {
 			SendClientMessage(playerid,0xAA000AA,"text");
      }
      case 2:
      {
		  SendClientMessage(playerid,0xAA000AA,"text");
      }
    }
  }

	if(dialogid == 157 && response) 
  {
    switch(listitem)
    {
      case 0:
      {
			SendClientMessage(playerid,0xAA000AA,"text");
      }
      case 1:
      {
 			SendClientMessage(playerid,0xAA000AA,"text");
      }
      case 2:
      {
		  SendClientMessage(playerid,0xAA000AA,"text");
      }
    }
  }
	return 1;
}
Reply
#5

Many errors. Sounds like 26 errors . Am I right? If yes, you aremissing a starting or ending bracket like this "}"
It is also possible that you have 1 to much.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)