How to create multiple dialogs
#3

I think this is what your looking for;

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == DIALOG_CLASS)
	{
		if(!response) return ShowPlayerDialog(playerid, DIALOG_CLASS, DIALOG_STYLE_LIST, "Choose your class", "Class 1\nClass 2\nClass 3", "Choose", "");
		switch(listitem)
		{
			case 0:
			{
				ShowPlayerDialog(playerid, Class1, DIALOG_STYLE_MSGBOX, "Class 1 information", "Information...", "Choose", "Cancel");
			}
			case 1:
			{
				ShowPlayerDialog(playerid, Class2, DIALOG_STYLE_MSGBOX, "Class 2 information", "Information...", "Choose", "Cancel");
			}
			case 2:
			{
				ShowPlayerDialog(playerid, Class3, DIALOG_STYLE_MSGBOX, "Class 3 information", "Information...", "Choose", "Cancel");
			}
		}
	}
	if(dialogid == Class1)
	{
		if(response)
		{
			GivePlayerWeapon(playerid, 23, 200);
			SetPlayerHealth(playerid, 100);
			SetPlayerSkin(playerid, 8);
		}
		else return ShowPlayerDialog(playerid, DIALOG_CLASS, DIALOG_STYLE_LIST, "Choose your class", "Class 1\nClass 2\nClass 3", "Choose", "");
	}
	if(dialogid == Class2)
	{
		if(response)
		{
			GivePlayerWeapon(playerid, 23, 200);
			SetPlayerHealth(playerid, 100);
			SetPlayerSkin(playerid, 8);
		}
		else return ShowPlayerDialog(playerid, DIALOG_CLASS, DIALOG_STYLE_LIST, "Choose your class", "Class 1\nClass 2\nClass 3", "Choose", "");
	}
	if(dialogid == Class3)
	{
		if(response)
		{
			GivePlayerWeapon(playerid, 23, 200);
			SetPlayerHealth(playerid, 100);
			SetPlayerSkin(playerid, 8);
		}
		else return ShowPlayerDialog(playerid, DIALOG_CLASS, DIALOG_STYLE_LIST, "Choose your class", "Class 1\nClass 2\nClass 3", "Choose", "");
	}
		
	return 1;
}
Basically when you click a class, it brings up a new dialog showing all the information. if you click choose it sets you with that class's health/skin/weapons ect. obviously you just add your stuff in there...

don't forget to +rep
Reply


Messages In This Thread
How to create multiple dialogs - by MSI - 20.01.2012, 21:17
Re: How to create multiple dialogs - by BleverCastard - 20.01.2012, 21:29
Re: How to create multiple dialogs - by Shadow_ - 20.01.2012, 21:43
Re: How to create multiple dialogs - by MSI - 21.01.2012, 17:57

Forum Jump:


Users browsing this thread: 1 Guest(s)