SA-MP Forums Archive
Dialogs Problem - 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: Dialogs Problem (/showthread.php?tid=255524)



Dialogs Problem - Sid_Alexander - 15.05.2011

hey guys, i made a Dialog like /shop in game, which allows people to buy stuff, but the problem i see is when people hit Ok they buy a weapon, but even if they hit cancel they buy a weapon, can you help?


Re: Dialogs Problem - lavamike - 16.05.2011

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])

The 'response' tells you what button they pressed.
1 for first button and 0 for second button

So if Ok is the first button and Cancel is the 2nd button you could do like:

if(response == 0) return 1;


Source: https://sampwiki.blast.hk/wiki/OnDialogResponse