SA-MP Forums Archive
Dialog listing(categories) - 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)
+--- Thread: Dialog listing(categories) (/showthread.php?tid=359533)



Dialog listing(categories) - Subwoofer - 14.07.2012

Hi everyone, im sitting here with one problem, when i make dialog(gun menu etc) then how do i make categories? like for guns i want to make shotguns, SMG's etc, how do i make it?


Re: Dialog listing(categories) - fadhilkab - 14.07.2012

https://sampforum.blast.hk/showthread.php?tid=251474


Re: Dialog listing(categories) - Subwoofer - 14.07.2012

Quote:
Originally Posted by fadhilkab
Посмотреть сообщение
there is not shown how to make categories


Re: Dialog listing(categories) - clarencecuzz - 14.07.2012

ShowPlayerDialog(playerid, dialogid, style, "Dialog Title", "Category 1\nCategory 2\nCategory 3","Okay","Exit");

Use '\n' to separate categories, Category 1 becomes case 0. Category 2 becomes case 1. Category 3 becomes case 2. So when you call OnDialogResponse, use case to define categories.
Example:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == dialogid) //If they responded to our dialog
    {
        if(response) // If they pressed the Okay button.
        {
            switch(listitem) //Start using list items, like Category 1, 2, 3 etc.
            {
                case 0: //If they chose Category 1
                {
                    //Do something here.
                }
                case 1: //If they chose Category 2
//Code Continues...



Re: Dialog listing(categories) - Subwoofer - 14.07.2012

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
ShowPlayerDialog(playerid, dialogid, style, "Dialog Title", "Category 1\nCategory 2\nCategory 3","Okay","Exit");

Use '\n' to separate categories, Category 1 becomes case 0. Category 2 becomes case 1. Category 3 becomes case 2. So when you call OnDialogResponse, use case to define categories.
Example:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == dialogid) //If they responded to our dialog
    {
        if(response) // If they pressed the Okay button.
        {
            switch(listitem) //Start using list items, like Category 1, 2, 3 etc.
            {
                case 0: //If they chose Category 1
                {
                    //Do something here.
                }
                case 1: //If they chose Category 2
//Code Continues...
Thanks


Re: Dialog listing(categories) - Pillhead2007 - 09.09.2012

I want to make catagories say i.e dance , rock , classic rock but then within them catagories there a list items to choose from how would I do that