SA-MP Forums Archive
help dialogs #may have in asking, i forget - 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: help dialogs #may have in asking, i forget (/showthread.php?tid=505181)



help dialogs #may have in asking, i forget - kloning1 - 07.04.2014

how to combine
I have 2 dialogs,

well how to combine them, with the click Next in the bottom

#sorry bad english, i use translate


Re: help dialogs #may have in asking, i forget - iBanner - 07.04.2014

Saw this simple tut somewhere in help section.

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
     if (strcmp("/info", cmdtext, true, 10) == 0)
    {
         ShowPlayerDialog(playerid,0,DIALOG_STLYE_MSGBOX,"Text Here","More Here","Button1","Button2");
         return 1;
    }
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
{
 switch(dialogid == 0)
  	{
	case 1:
	{
	   ShowPlayerDialog(playerid,1,DIALOG_STLYE_MSGBOX,"Text Here","More Here","Button1","Button2");
	}
}
switch(dialogid == 1)
  	{
	case 1:
	{
	   ShowPlayerDialog(playerid,0,DIALOG_STLYE_MSGBOX,"Text Here","More Here","Button1","Button2");
	}
    }
    }
    return 1;
}



Re: help dialogs #may have in asking, i forget - kloning1 - 07.04.2014

where next text sir :3 :v I do not understand


Re: help dialogs #may have in asking, i forget - superrobot48 - 07.04.2014

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1) //First dialog
   {
         if(response)
         {
         ShowPlayerDialog(playerid,0,DIALOG_STLYE_MSGBOX,"Next Dialog","Dialog Desc","Button1","Button2"); //showing second dialog
         }
    }
}
hope it help


Re: help dialogs #may have in asking, i forget - kloning1 - 07.04.2014

this code sir,
help me please

pawn Код:
CMD:radio(playerid, params[])
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "{00FF00}Radio", "[Radio Indonesia]Surabaya\n //NEED THIS SIR//", "Okay", "Close");
        return 1;
    }

CMD:radio2(playerid, params[])
    {
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "{00FF00}Radio", "Boneyaad Radio\nIbiza Global Radio\nOff radio", "Okay", "Close");
        return 1;
    }

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1) {
        if(response) {
            if(listitem == 0) {
                PlayAudioStreamForPlayer(playerid, "http://49.213.21.119:8000/listen.pls");
            }
            if(listitem == 1) {
                PlayAudioStreamForPlayer(playerid, "");
        }
    }
    return 1;
}
if(dialogid == 2) {
        if(response) {
            if(listitem == 1) {
                PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=7581");
            }
            if(listitem == 2) {
                PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=180590");
            }
            if(listitem == 5) {
                PlayAudioStreamForPlayer(playerid, "Radio Stopped sir,");
            }
        }
    }
    return 1;
}



Re: help dialogs #may have in asking, i forget - superrobot48 - 07.04.2014

Код:
CMD:radio(playerid, params[])
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "{00FF00}Radio", "[Radio Indonesia]Surabaya\n Boneyaad Radio", "Okay", "Close");
        return 1;
    }
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1) {
        if(response) {
            if(listitem == 0) {
                PlayAudioStreamForPlayer(playerid, "http://49.213.21.119:8000/listen.pls");
            }
            if(listitem == 1) {
                ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "{00FF00}Radio", "Boneyaad Radio\nIbiza Global Radio\nOff radio", "Okay", "Close");
        }
    }
    return 1;
}
hope it helps +rep if i did thanks


Re: help dialogs #may have in asking, i forget - kloning1 - 07.04.2014

Quote:
Originally Posted by superrobot48
Посмотреть сообщение
Код:
CMD:radio(playerid, params[])
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "{00FF00}Radio", "[Radio Indonesia]Surabaya\n Boneyaad Radio", "Okay", "Close");
        return 1;
    }
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1) {
        if(response) {
            if(listitem == 0) {
                PlayAudioStreamForPlayer(playerid, "http://49.213.21.119:8000/listen.pls");
            }
            if(listitem == 1) {
                ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "{00FF00}Radio", "Boneyaad Radio\nIbiza Global Radio\nOff radio", "Okay", "Close");
        }
    }
    return 1;
}
hope it helps +rep if i did thanks
combine sir, not add in 1 dialogs :3
try to notice,
The first dialog, next word,
, if clicked, the dialogue can move to the second


Re: help dialogs #may have in asking, i forget - superrobot48 - 07.04.2014

Your script has loose indentation warning plz gimme a nice script


Re: help dialogs #may have in asking, i forget - superrobot48 - 07.04.2014

try this. sorry for spam
Код:
#include <a_samp>
#include <zcmd>

CMD:radio(playerid, params[])
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "{00FF00}Radio", "[Radio Indonesia]Surabaya\n //NEED THIS SIR//", "Okay", "Next");
        return 1;
    }

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1) {
        if(response) {
            if(listitem == 0) {
                PlayAudioStreamForPlayer(playerid, "http://49.213.21.119:8000/listen.pls");
            }
            if(listitem == 1) {
                PlayAudioStreamForPlayer(playerid, "");
        	}
    	}
    	else if(!response) {
   	 	ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "{00FF00}Radio", "Boneyaad Radio\nIbiza Global Radio\nOff radio", "Okay", "Close");
   	 	}

		return 1;
}
if(dialogid == 2) {
        if(response) {
            if(listitem == 1) {
                PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=7581");
            }
            if(listitem == 2) {
                PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=180590");
            }
            if(listitem == 5) {
                PlayAudioStreamForPlayer(playerid, "Radio Stopped sir,");
            }
        }
    }
return 1;
}



Respuesta: help dialogs #may have in asking, i forget - Snoopythekill - 07.04.2014

Yo hablo espaсol ._. no entiendo tu traductor explicame y te ayudo, si lo que quieres es usar un solo dialogo para los dos, puedes hacer esto:
pawn Код:
#define Dialogo 1

CMD:radio(playerid, params[])
{
ShowPlayerDialog(playerid, Dialogo, DIALOG_STYLE_LIST, "{00FF00}Radio", "[Radio Indonesia]Surabaya\n //NEED THIS SIR//\nBoneyaad Radio\nIbiza Global Radio\nOff radio", "Okay", "Close");
return 1;
}


if(dialogid == Dialogo)
{
if(response)
{
switch(listitem)
{
case 0: PlayAudioStreamForPlayer(playerid, "http://49.213.21.119:8000/listen.pls");
case 1: PlayAudioStreamForPlayer(playerid, "samp");
case 2: PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=7581");
case 3: PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=180590");
case 4: PlayAudioStreamForPlayer(playerid, "Radio Stopped sir");
}
}
return 1;
}