Tutorial for scripting player dialogue
#8

pawn Код:
// EXAMPLE SCRIPT
    ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"What is it that you want?","Beer\r\nWine\r\nVodka","OK","Cancel");

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid==1) // The ID is 1
    {
        if(response) // response = If player clicks the first button (in this case It is "OK")
        {
            if(listitem==0)
            {
                // If player choose Beer
            }
            else if(listitem==1)
            {
                // If Player Choose Wine
            }
            else if(listitem==2)
            {
                // If player choose Vodka
            }
        }
        else if(!response) // !response = If player clicks the second button (in this case It is "Cancel")
        {
            // If you want the dialog to appear again when player clicks Cancel just put the ShowPlayerDialog line inside here
        }
    }
    return 1;
}
Reply


Messages In This Thread
Tutorial for scripting player dialogue - by Legit_V20 - 21.01.2011, 08:23
Re: Tutorial for scripting player dialogue - by iJumbo - 21.01.2011, 08:24
Re: Tutorial for scripting player dialogue - by Georgelopez1 - 21.01.2011, 08:24
Re: Tutorial for scripting player dialogue - by Legit_V20 - 21.01.2011, 09:05
Re: Tutorial for scripting player dialogue - by Sascha - 21.01.2011, 09:14
Re: Tutorial for scripting player dialogue - by Legit_V20 - 21.01.2011, 10:09
Re: Tutorial for scripting player dialogue - by Legit_V20 - 21.01.2011, 10:13
Re: Tutorial for scripting player dialogue - by Mike Garber - 21.01.2011, 11:39

Forum Jump:


Users browsing this thread: 1 Guest(s)