SA-MP Forums Archive
Adding string to dialog? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Adding string to dialog? (/showthread.php?tid=141639)



Adding string to dialog? - Naxix - 14.04.2010

Hello! I've just started to use dialog, and i made a couple and it went well.

But than i wanted to add a string to the dialog msgbox, but i can't figure out how i add the string as the text instead of text.

i tried with:

Код:
ShowPlayerDialog(playerid, 10, DIALOG_STYLE_MSGBOX, "Members", "string", "Back", "Close");
Код:
  		if(dialogid == 10)
	{
	  if(response)
		{
		  if(listitem == 0)
		  {
		    new name[MAX_PLAYER_NAME],string[128];
   			for(new i=0;i<MAX_PLAYERS;i++)
				{
					if(COP[i] >= 1)
					{
						if(IsPlayerConnected(i))
						{
							GetPlayerName(i,name,sizeof(name));
							format(string,sizeof(string),"%s",name);
							SendClientMessage(playerid, COLOUR_WHITE, string);
							return 1;
						}
						else
						{
				  		ShowPlayerDialog(playerid, 9, DIALOG_STYLE_LIST, "Police Station", " Join \n Leave \n Members", "Select", "Close");
							return 1;
						}
					}
				}
      }
		}
	}
But that would just show "string" when i open it, and it wont go back to the dialog ID 9..

Can any1 tell me how to add strings?

-Best regards Naxix


Re: Adding string to dialog? - actiwe - 14.04.2010

string without ' " ' . Then it must be..


Re: Adding string to dialog? - Naxix - 14.04.2010

Like this:
Код:
ShowPlayerDialog(playerid, 10, DIALOG_STYLE_MSGBOX, "Members", string, "Back", "Close");
as string isn't defined there, it will get defined in the Itemlist first??