SA-MP Forums Archive
[TUTORIAL]Getting things from dialogs - 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)
+--- Thread: [TUTORIAL]Getting things from dialogs (/showthread.php?tid=435074)



[TUTORIAL]Getting things from dialogs - BlackHorse - 05.05.2013

This is a tutorial of getting some thing like weapons,drink etc from dialog.Dialog type must be list
Tutorial Start
First create a dialog like this
Quote:

ShowPlayerDialog(playerid, you like the ID of dialog, DIALOG_STYLE_LIST, "Weapons", "AK47 $7000 Ammo:450", "Choose", "Cancle");

This shows that AK47 for price $7000 and his ammo is 450.now question is how we get it.To get it follow this tutorial
Quote:

public OnPlayerDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == the id of dialog you typed)
{
if(response)
{
switch(listitem)
{
case 0://it means item number
{
//The thing you want to do if the player select item
}
}
}
}
return 1;
}

The spaces i gave in quote it can't be displayed
THE END


Re: [TUTORIAL]Getting things from dialogs - BlazingKnife - 05.05.2013

Wrong Section
Should Be In The Tutorial's Section