Posts: 37
Threads: 10
Joined: Jan 2011
Reputation:
0
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!
Posts: 37
Threads: 10
Joined: Jan 2011
Reputation:
0
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
Posts: 1,495
Threads: 131
Joined: Jul 2009
Reputation:
0
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)...........
}
Posts: 37
Threads: 10
Joined: Jan 2011
Reputation:
0
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
Posts: 37
Threads: 10
Joined: Jan 2011
Reputation:
0
OK I GET WHAT UR SAYING NOW, so how do i set the function for the second button?
Posts: 1,506
Threads: 69
Joined: Feb 2008
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;
}