07.09.2012, 11:34
How do i save a dialog into for e.g a variable? And then use it later?
//On Top
new DialogStr[256];
//Saving the string
format(DialogStr,sizeof(DialogStr),".....................................");
//Using it
ShowPlayerDialog(playerid,ID,DIALOG_STYLE_MSGBOX,"Dialog",DialogStr,"1","2");
#define DIALOG "Hello, my nickname is %s!"
new string[128];
format(string,128,""DIALOG" and this is another text included!","irinel1996");
ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"My name",string,"OK","");
new dialogID[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
dialogID[playerid] = -1;
return 1;
}
stock ShowDialogCase(playerid, caseid)
{
switch (caseid)
{
case 0:
{
ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"My name dialog 1",string,"OK","");
if(dialogID[playerid] != 0) dialogid[playerid] = 0;
}
case 1:
{
ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"My name dialog 2",string,"OK","");
if(dialogID[playerid] != 1) dialogID[playerid] = 1;
}
}
return caseid;
}
ShowDialogCase(playerid, dialogID[playerid]);
dialogID[playerid] = -1; // to reset
dialogID[playerid] = 1; // save the dialogid and then show by using ShowDialogCase