Please help me with dialogs.
#1

I'm trying to create a dialog so when some one is in front of their faction locker they can do /duty to save on commands, and the main Dialog I have it so the options are

Duty[Sets their color name etc]
Clothes[allows them to have their faction clothes]
Weapons[Faction weapons]
Undercover[To have undercover skins]

So for example when they hit "Clothes" I want it to go to another dialog that has choices of clothes, please can you tell me how to do that? I'v seen the SAMP Wiki but they do not explain how to do it. PLEASE DO NOT DO IT FOR ME i'm learning how to script so if you could just link me to a tutorial it would be greatfull, thank you.
Reply
#2

wiki.sa-mp.com
Reply
#3

All you need is ShowPlayerDialog and OnDialogResponse.

If you want to learn, then start making it yourself and ask specific questions here if you get stuck.
Reply
#4

This tutorial will probably help you: https://sampwiki.blast.hk/wiki/How_to_Create_a_Dialog


In your case you have a list dialog. That means your should look like this:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG1) //Here you have to put the dialogid of your main dialog
{
if(response == 1)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid,DIALOG_CLOTHES,DIALOG_STYLE_LIST,"Clothes","Item1\nItem2","Buy","Cancel");
}
case 1:
{
//2nd
}
case 2:
{
//3rd
}
}
}
}

return 1;
}
Reply
#5

I was just looking for a overall tutorial on how to make a dialog response, Heres a specific question for example.

I want it so when they hit Clothes another dialog will pop up with clothes selection. IDK if I explained that so you could understand it easy.

EDIT- Anyone can add me on

SKype: RussianDisk
MSN: Azzeto@live.com
AOL: Azzeto@aol.com

If you wish to help me more advanced and explain it to me easier, Thanks.

@Gomma, I already checked the wiki on the dialog help, but it didn't really explain how to make the dialog.
Reply
#6

Here's an example:

pawn Код:
#define DIALOG_DUTY 10
#define DIALOG_CLOTHES 11
pawn Код:
ShowDialog(playerid, dialogid)
{
    switch(dialogid)
    {
        case DIALOG_DUTY:
        {
            ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, "Duty", "Duty\nClothes\nWeapons\nUndercover", "Select", "Cancel");
        }
        case DIALOG_CLOTHES:
        {
            ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, "Clothes", "Nice Clothes\nGood Clothes\nAwesome Clothes", "Select", "Cancel");
        }
    }
}
in /duty command
pawn Код:
ShowDialog(playerid, DIALOG_DUTY);
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_DUTY)
    {
        if(response)
        {
            switch(listitem)
            {
            case 0: // when player chooses "Duty"
            case 1: ShowDialog(playerid, DIALOG_CLOTHES);
            case 2: // when player chooses "Weapons"
            case 3: // when player chooses "Undercover"
            }
        }
        return 1;
    }
    if(dialogid == DIALOG_CLOTHES)
    {
        if(response)
        {
            switch(listitem)
            {
            case 0: // when player chooses "Nice Clothes"
            case 1: // when player chooses "Good Clothes"
            case 2: // when player chooses "Awesome Clothes"
            }
        }
        return 1;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)