how create back button
#1

.
Reply
#2

pawn Код:
if (dialogid == DIALOGID)
{
if(response == 0)
{
//BACK FUNCTION
}
if(response) // or if(response == 1)
{
//First Button pressed
Reply
#3

.
Reply
#4

Try this:

pawn Код:
if(response == 0)
{
ShowPlayerDialog(playerid, IDPBOOK, DIALOG_STYLE_LIST, "LSPD BOOK by Peter_Petrolli", "None\npage1:lessons\npage2:getting on duty \npage3:radio chat/teamchat\npage4:codes\npage5:weapons\npage6:rank\npage7:all others(very important)","Select", "Cancel");
}

if(response == 1)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid,101,DIALOG_STYLE_INPUT,"page 1","this book will tell you how to be a good cop,but it doesn't says everything to be a good cop \n thats why we would suggest to ask Peter Petrolli for extras lessons,these are boring but very usefull \n\n good luck cadet"," Select","Back");
}
...
Reply
#5

..
Reply
#6

A basic exemple for you:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOGID)
{
if(response == 0)
{
//BACK FUNCTION
}
//----------------------------------------------------------------
if(response)
{
if(listitem == 0)
{
//FIRST LIST ITEM
}
if(listitem == 1)
{
SECOND ITEM
}
...

}
}
return 0;
}
Reply
#7

yes i did
Код:
#include <a_samp>
#define IDPBOOK 100

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/pdbook", cmdtext, true, 10) == 0)
	{
		ShowPlayerDialog(playerid, IDPBOOK, DIALOG_STYLE_LIST, "LSPD BOOK by Peter_Petrolli", "None\npage1:lessons\npage2:getting on duty \npage3:radio chat/teamchat\npage4:codes\npage5:weapons\npage6:rank\npage7:all others(very important)","Select", "Cancel");
		return 1;
	}
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == IDPBOOK)
	{
		if(response==0)
		{
			ShowPlayerDialog(playerid, IDPBOOK, DIALOG_STYLE_LIST, "LSPD BOOK by Peter_Petrolli", "None\npage1:lessons\npage2:getting on duty \npage3:radio chat/teamchat\npage4:codes\npage5:weapons\npage6:rank\npage7:all others(very important)","Select", "Cancel");
		}
		if(response)
		{
			if(listitem == 1)
			{
			ShowPlayerDialog(playerid,101,DIALOG_STYLE_INPUT,"page 1","this book will tell you how to be a good cop,but it doesn't says everything to be a good cop \n thats why we would suggest to ask Peter Petrolli for extras lessons,these are boring but very usefull \n\n good luck cadet","Select"," Back");
			}
			if(listitem == 2)
			{
			ShowPlayerDialog(playerid,102,DIALOG_STYLE_INPUT,"Page 2","(very usefull : /cophelp) to go on duty you must first go to the police station \n once you are in,go to the first door and typ '/door' and when u passed it then use '/doorc' to close it again \n then use '/olockers' to open the door of the lockers,once u are at a locker typ '/duty' to go on duty \n for more info about weapons from the locker check 'weapons' page","Select","Back");
			}
			if(listitem == 3)
			{
			ShowPlayerDialog(playerid,103,DIALOG_STYLE_INPUT,"Page 3","the radio chat,the most important chat of being a police \n to use the chat use /r (message),remember this chat is always IC (in character) so always act like the person you are in the game \n an other important chat is /m (megaphone) to tell people in cars (like in a chase) to stop \n for example : /m PULL OVER!, and the last chat : /me,it's the 'roleplaychat'","Select"," Back");
			}
			if(listitem == 4)
			{
			ShowPlayerDialog(playerid,104,DIALOG_STYLE_INPUT,"Page 4","the codes are very important on the radio chat,u can check the codes with /codes \n without knowing the codes,u won't get far,believe me","Select"," Fabian");
			}
			if(listitem == 5)
			{
			ShowPlayerDialog(playerid,105,DIALOG_STYLE_INPUT,"Page 5","A cop without weapons,never seen that before and that's good too \n without weapons we wouldn't be that strong, u already know that u get weapons by doing /duty \n u can also get weapons by typing /wkit but u need to be a certain rank for every WeaponKIT \n the higher your ran the better your weapons (read page 7 - rank for more info)","Select"," Back");
			}
			if(listitem == 6)
			{
			ShowPlayerDialog(playerid,106,DIALOG_STYLE_INPUT,"Page 6","The rank,it's what tells others : i'm your boss and i am a very good cop and got promorted \n the rank is like a level in being a cop,the higher your level,the better your weapons and the more u can do as a cop \n\n ranks : \n 1 cadet \n 2 officer \n 3 luitenant \n 4 seargant \n 5 captain (highest possible) \n 6 chief (Peter Petrolli only) \n\n good luck with ranking up","Select"," Back");
			}
			if(listitem == 7)
			{
			ShowPlayerDialog(playerid,107,DIALOG_STYLE_INPUT,"Page 7","this is important for higher ranked persons : higher levels are allowed more check /cophelp if u are ranked up and check the new WKIT","Select"," Back");
			}
		}
		return 1;
	}
	return 0;
}
its not correct?
Reply
#8

Seems to be all right.

Over all, what are you trying to do? 0o
Reply
#9

i try to back principal menu with all pages when i ckick on back button
but when i click on back button the window disapear
Reply
#10

Omg. Use this (Basic Exemple):

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == IDPBOOK)
    {
        if(response)
        {
            if(listitem == 1)
            {
            ShowPlayerDialog(playerid,101,DIALOG_STYLE_INPUT,"page 1","this book will tell you how to be a good cop,but it doesn't says everything to be a good cop \n thats why we would suggest to ask Peter Petrolli for extras lessons,these are boring but very usefull \n\n good luck cadet","Select"," Back");
            }
            if(listitem == 2)
            {
            ShowPlayerDialog(playerid,102,DIALOG_STYLE_INPUT,"Page 2","(very usefull : /cophelp) to go on duty you must first go to the police station \n once you are in,go to the first door and typ '/door' and when u passed it then use '/doorc' to close it again \n then use '/olockers' to open the door of the lockers,once u are at a locker typ '/duty' to go on duty \n for more info about weapons from the locker check 'weapons' page","Select","Back");
            }
            if(listitem == 3)
            {
            ShowPlayerDialog(playerid,103,DIALOG_STYLE_INPUT,"Page 3","the radio chat,the most important chat of being a police \n to use the chat use /r (message),remember this chat is always IC (in character) so always act like the person you are in the game \n an other important chat is /m (megaphone) to tell people in cars (like in a chase) to stop \n for example : /m PULL OVER!, and the last chat : /me,it's the 'roleplaychat'","Select"," Back");
            }
            if(listitem == 4)
            {
            ShowPlayerDialog(playerid,104,DIALOG_STYLE_INPUT,"Page 4","the codes are very important on the radio chat,u can check the codes with /codes \n without knowing the codes,u won't get far,believe me","Select"," Fabian");
            }
            if(listitem == 5)
            {
            ShowPlayerDialog(playerid,105,DIALOG_STYLE_INPUT,"Page 5","A cop without weapons,never seen that before and that's good too \n without weapons we wouldn't be that strong, u already know that u get weapons by doing /duty \n u can also get weapons by typing /wkit but u need to be a certain rank for every WeaponKIT \n the higher your ran the better your weapons (read page 7 - rank for more info)","Select"," Back");
            }
            if(listitem == 6)
            {
            ShowPlayerDialog(playerid,106,DIALOG_STYLE_INPUT,"Page 6","The rank,it's what tells others : i'm your boss and i am a very good cop and got promorted \n the rank is like a level in being a cop,the higher your level,the better your weapons and the more u can do as a cop \n\n ranks : \n 1 cadet \n 2 officer \n 3 luitenant \n 4 seargant \n 5 captain (highest possible) \n 6 chief (Peter Petrolli only) \n\n good luck with ranking up","Select"," Back");
            }
            if(listitem == 7)
            {
            ShowPlayerDialog(playerid,107,DIALOG_STYLE_INPUT,"Page 7","this is important for higher ranked persons : higher levels are allowed more check /cophelp if u are ranked up and check the new WKIT","Select"," Back");
        }
    }
//--------------------------> IF DIALOG ID 101 IS OPENED
    if(dialogid == 101)
    {
        if(response == 0) //IF RESPONSE IS 'BACK'
        {
            ShowPlayerDialog(playerid, IDPBOOK, DIALOG_STYLE_LIST, "LSPD BOOK by Peter_Petrolli", "None\npage1:lessons\npage2:getting on duty \npage3:radio chat/teamchat\npage4:codes\npage5:weapons\npage6:rank\npage7:all others(very important)","Select", "Cancel");
        }
        if(response) //IF RESPONSE IF FIRST BUTTON
        {
            //FUNCTION FOR DIALOG 101 HERE
            }
        }
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)