Using more than one dialog? - 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: Using more than one dialog? (
/showthread.php?tid=138299)
Using more than one dialog? -
Assyria - 01.04.2010
Hello!
Код:
if (strcmp("/test", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 157, DIALOG_STYLE_LIST, "Service", "pah \npoh \npih", "Select", "Cancel");
return 1;
}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 157 && response)
{
switch(listitem)
{
case 0:
{
SendClientMessage(playerid,0xAA000AA,"text");
}
case 1:
{
SendClientMessage(playerid,0xAA000AA,"text");
}
case 2:
{
SendClientMessage(playerid,0xAA000AA,"text");
}
}
}
return 1;
}
I want to add another dialog, but If I do, it ends up with many errors.
I read from samp wiki that I have to use somekind of switch, but It wasnt explained there.
So how to?
Regards,
Assyria
Re: Using more than one dialog? -
Assyria - 01.04.2010
Anyone?
Re: Using more than one dialog? -
aircombat - 01.04.2010
what u mean with alot of errors i have more than 5 dialogs in my server and nothing happens , alot of errors probably means a missing Bracket
Re: Using more than one dialog? -
GTAguillaume - 01.04.2010
Example
Dialog 1
Код:
ShowPlayerDialog(playerid, 157, DIALOG_STYLE_LIST, "Service", "pah \npoh \npih", "Select", "Cancel");
Dialog 2
Код:
ShowPlayerDialog(playerid, 158, DIALOG_STYLE_LIST, "Service", "pah \npoh \npih", "Select", "Cancel");
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 158 && response)
{
switch(listitem)
{
case 0:
{
SendClientMessage(playerid,0xAA000AA,"text");
}
case 1:
{
SendClientMessage(playerid,0xAA000AA,"text");
}
case 2:
{
SendClientMessage(playerid,0xAA000AA,"text");
}
}
}
if(dialogid == 157 && response)
{
switch(listitem)
{
case 0:
{
SendClientMessage(playerid,0xAA000AA,"text");
}
case 1:
{
SendClientMessage(playerid,0xAA000AA,"text");
}
case 2:
{
SendClientMessage(playerid,0xAA000AA,"text");
}
}
}
return 1;
}
Re: Using more than one dialog? -
bartje01 - 01.04.2010
Many errors. Sounds like 26 errors . Am I right? If yes, you aremissing a starting or ending bracket like this "}"
It is also possible that you have 1 to much.