dialogid bug - 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: dialogid bug (
/showthread.php?tid=595305)
dialogid bug -
Karolukas123 - 01.12.2015
Hey, so i create dialog_style_list and do some coding on list but if i press on text in dialog it nothging happen
Код:
}
CMD:vm(playerid)
{
ShowPlayerDialog(playerid, 600, DIALOG_STYLE_LIST, "Test", "1\n2\n3\n4", "Press", "Bye");
return 1;
}
if(dialogid == 600)
{
if(response)
{
switch(listitem)
{
case 0:
{
SendClientMessage(playerid, -1, "Test");
}
case 1:
{
SendClientMessage(playerid, -1, "Test");
}
case 2:
{
SendClientMessage(playerid, -1, "Test");
}
case 3:
{
SendClientMessage(playerid, -1, "Test");
}
}
}
return 1;
Re: dialogid bug -
TwinkiDaBoss - 01.12.2015
Better define dialog before you use it so you can later on know what dialog is for what
PHP код:
#define MyDialogName 600
CMD:vm(playerid)
{
ShowPlayerDialog(playerid, MyDialogName, DIALOG_STYLE_LIST, "Test", "1\n2\n3\n4", "Press", "Bye");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == MyDialogName) {
if(!response) return SendClientMessage(playerid,COLOR_RED,"Bye to you too");
if(response) {
switch(listitem) {
case 0: SendClientMessage(playerid,COLOR_RED,"Hi 1.");
case 1: SendClientMessage(playerid,COLOR_RED,"Hi 2.");
case 2: SendClientMessage(playerid,COLOR_RED,"Hi 3.");
case 3: SendClientMessage(playerid,COLOR_RED,"Hi 4.");
}
}
}
return 1;
}