Tutorial for scripting player dialogue - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Tutorial for scripting player dialogue (
/showthread.php?tid=214387)
Tutorial for scripting player dialogue -
Legit_V20 - 21.01.2011
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!
Re: Tutorial for scripting player dialogue -
iJumbo - 21.01.2011
pyrokar@libero.it
ask me in msn
i help u
Re: Tutorial for scripting player dialogue -
Georgelopez1 - 21.01.2011
https://sampwiki.blast.hk/wiki/How_to_Create_a_Dialog
Re: Tutorial for scripting player dialogue -
Legit_V20 - 21.01.2011
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
Re: Tutorial for scripting player dialogue -
Sascha - 21.01.2011
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)...........
}
Re: Tutorial for scripting player dialogue -
Legit_V20 - 21.01.2011
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
Re: Tutorial for scripting player dialogue -
Legit_V20 - 21.01.2011
OK I GET WHAT UR SAYING NOW, so how do i set the function for the second button?
Re: Tutorial for scripting player dialogue -
Mike Garber - 21.01.2011
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;
}