Tutorial for scripting player dialogue
#1

I cant find a good tutorial on how to script player dialogue can somebody give me a link please? i have searched the forums and samp wiki. Thankyou!
Reply
#2

pyrokar@libero.it


ask me in msn i help u
Reply
#3

https://sampwiki.blast.hk/wiki/How_to_Create_a_Dialog
Reply
#4

for the dialog it says
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What is it that you want?", "Sprunk ($1)\nBeer ($2)\nWine ($3)", "Purchase", "Cancel");

how do i make it so there is no cancel? cuz it says number of arguments does not match definition

I cant have the last option
Reply
#5

you have to use 2 buttons..
think up a good text for the second and later just ignore the "response" at the OnDialogResponse...
e.g.
if(dialogid == 1)
{
if(listitem == 0)...........
}
Reply
#6

but it isnt text one of the buttons teleports you and the other one doesnt, You have to teleport I cant let the chance slip you would get what i am saying if you joined my server, but the point is i need to either have the second button do either nothing or not be there, can you plese try to help me out bro
Reply
#7

OK I GET WHAT UR SAYING NOW, so how do i set the function for the second button?
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)