SA-MP Forums Archive
Dialog troubles - 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: Dialog troubles (/showthread.php?tid=431944)



Dialog troubles - xXRealLegitXx - 20.04.2013

Hello. Today I am having a problem with my dialogs.

This is the command that issues it:

Код:
CMD:sfpdlocker(playerid, params[])
{
    ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Select an Option", "First Aid Kit\nKevlar Vest\nStandard Issued Weapons\n", "Select", "Cancel");
    return 1;
}
This is the code that is under OnDialog thingy

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid==1 && response==1)
    {

    switch(listitem)
    {
        case 0:
        {
        SendClientMessage(playerid,-1,"You tune the radio station to 'Power 181'");
        PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002");
        }
        case 1:
        {
        SendClientMessage(playerid, -1, "You tune the radio station to 'Late 90's");
        PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-lite90s.pls");
        }
        case 2:
        {
        SendClientMessage(playerid, -1, "You tune the radio station to 'Late 80's");
        PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-lite80s.pls");
        }
        case 3:
        {
        SendClientMessage(playerid, -1, "You tune the radio station to 'Kickin' Country'");
        PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-kickincountry.pls");
 	  	}
        case 4:
        {
        SendClientMessage(playerid, -1, "You tune the radio station to 'Highway 181'");
        PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-highway.pls");
        }
        case 5:
        {
        SendClientMessage(playerid, -1, "You tune the radio station to 'Good Time Oldies'");
        PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-goodtime.pls");
        }
        case 6:
        {
        SendClientMessage(playerid, -1, "You tune the radio station to 'Fusion Jazz'");
        PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/asx/181-fusionjazz.asx");
        }
        case 7:
        {
        SendClientMessage(playerid, -1, "You tune the radio station 'Rock 181'");
        PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-rock.pls");
        }
        case 8:
        {
        SendClientMessage(playerid, -1, "You tune the radio station to 'The Eagle'");
        PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-eagle.pls");
        }
        case 9:
        {
        SendClientMessage(playerid, -1, "You tune the radio station to 'The Office'");
        PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-office.pls");
        }
        case 10:
        {
        SendClientMessage(playerid, -1, "You tune the radio station to 'True R&B");
        PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-rnb.pls");
        }
        case 11:
        {
        SendClientMessage(playerid, -1, "You tune the radio station to 'Old School Hip Hop'");
        PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/asx/181-oldschool");
        }
        case 12:
        {
        SendClientMessage(playerid, -1, "You tune the radio station to 'True Blues'");
        PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/asx/181-blues.asx");
        }
        case 13:
        {
        SendClientMessage(playerid, -1, "You tune the radio station to 'The Mix'");
        PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-themix.pls");
        }
        case 14:
        {
        SendClientMessage(playerid, -1, "You tune the radio station to 'Gay FM'");
        PlayAudioStreamForPlayer(playerid, "http://stream.gayfm.de/");
        }
	case 15:
	{
	SendClientMessage(playerid, -1, "You tune the radio station to 'idobi Radio'");
	PlayAudioStreamForPlayer(playerid, "http://50.117.115.211:80");
	}
        case 16:
        {
        SendClientMessage(playerid, -1, "You tune the radio station and randomly come upon this.");
        PlayAudioStreamForPlayer(playerid, "http://orbzgaming.com/RvB%20Song.mp3");
        }
        case 17:
        {
        SendClientMessage(playerid, -1, "You stop the radio.");
        StopAudioStreamForPlayer(playerid);
        }

    }
}
    return 1;
}
But I want another dialog response, and I get a whole bunch of errors when I try. One that responds to the command I posted above. Please help

- Jason


Re: Dialog troubles - MattyG - 20.04.2013

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
    {
        if(dialogid == 1)
        {
            switch(listitem)
            {
                case 0:
                {
                SendClientMessage(playerid,-1,"You tune the radio station to 'Power 181'");
                PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002");
                }
                case 1:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Late 90's");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-lite90s.pls");
                }
                case 2:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Late 80's");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-lite80s.pls");
                }
                case 3:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Kickin' Country'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-kickincountry.pls");
                }
                case 4:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Highway 181'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-highway.pls");
                }
                case 5:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Good Time Oldies'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-goodtime.pls");
                }
                case 6:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Fusion Jazz'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/asx/181-fusionjazz.asx");
                }
                case 7:
                {
                SendClientMessage(playerid, -1, "You tune the radio station 'Rock 181'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-rock.pls");
                }
                case 8:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'The Eagle'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-eagle.pls");
                }
                case 9:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'The Office'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-office.pls");
                }
                case 10:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'True R&B");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-rnb.pls");
                }
                case 11:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Old School Hip Hop'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/asx/181-oldschool");
                }
                case 12:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'True Blues'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/asx/181-blues.asx");
                }
                case 13:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'The Mix'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-themix.pls");
                }
                case 14:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Gay FM'");
                PlayAudioStreamForPlayer(playerid, "http://stream.gayfm.de/");
                }
                case 15:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'idobi Radio'");
                PlayAudioStreamForPlayer(playerid, "http://50.117.115.211:80");
                case 16:
                {
                SendClientMessage(playerid, -1, "You tune the radio station and randomly come upon this.");
                PlayAudioStreamForPlayer(playerid, "http://orbzgaming.com/RvB%20Song.mp3");
                }
                case 17:
                {
                SendClientMessage(playerid, -1, "You stop the radio.");
                StopAudioStreamForPlayer(playerid);
                }
            }
        }
        else if(dialogid == 2)
        {
            //Do your code for dialogid 2 here
        }
    }
    return 1;
}



Re: Dialog troubles - xXRealLegitXx - 20.04.2013

Quote:
Originally Posted by MattyG
Посмотреть сообщение
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
    {
        if(dialogid == 1)
        {
            switch(listitem)
            {
                case 0:
                {
                SendClientMessage(playerid,-1,"You tune the radio station to 'Power 181'");
                PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002");
                }
                case 1:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Late 90's");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-lite90s.pls");
                }
                case 2:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Late 80's");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-lite80s.pls");
                }
                case 3:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Kickin' Country'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-kickincountry.pls");
                }
                case 4:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Highway 181'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-highway.pls");
                }
                case 5:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Good Time Oldies'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-goodtime.pls");
                }
                case 6:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Fusion Jazz'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/asx/181-fusionjazz.asx");
                }
                case 7:
                {
                SendClientMessage(playerid, -1, "You tune the radio station 'Rock 181'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-rock.pls");
                }
                case 8:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'The Eagle'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-eagle.pls");
                }
                case 9:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'The Office'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-office.pls");
                }
                case 10:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'True R&B");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-rnb.pls");
                }
                case 11:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Old School Hip Hop'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/asx/181-oldschool");
                }
                case 12:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'True Blues'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/asx/181-blues.asx");
                }
                case 13:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'The Mix'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-themix.pls");
                }
                case 14:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Gay FM'");
                PlayAudioStreamForPlayer(playerid, "http://stream.gayfm.de/");
                }
                case 15:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'idobi Radio'");
                PlayAudioStreamForPlayer(playerid, "http://50.117.115.211:80");
                case 16:
                {
                SendClientMessage(playerid, -1, "You tune the radio station and randomly come upon this.");
                PlayAudioStreamForPlayer(playerid, "http://orbzgaming.com/RvB%20Song.mp3");
                }
                case 17:
                {
                SendClientMessage(playerid, -1, "You stop the radio.");
                StopAudioStreamForPlayer(playerid);
                }
            }
        }
        else if(dialogid == 2)
        {
            //Do your code for dialogid 2 here
        }
    }
    return 1;
}
Got these errors:

Код:
C:\Users\Jason\Desktop\GG-Gaming\gamemodes\GGRP.pwn(3997) : error 014: invalid statement; not in switch
C:\Users\Jason\Desktop\GG-Gaming\gamemodes\GGRP.pwn(3997) : warning 215: expression has no effect
C:\Users\Jason\Desktop\GG-Gaming\gamemodes\GGRP.pwn(3997) : error 001: expected token: ";", but found ":"
C:\Users\Jason\Desktop\GG-Gaming\gamemodes\GGRP.pwn(3997) : error 029: invalid expression, assumed zero
C:\Users\Jason\Desktop\GG-Gaming\gamemodes\GGRP.pwn(3997) : fatal error 107: too many error messages on one line
On this line:
Код:
 case 16:
Код:
                case 16:
                {
                SendClientMessage(playerid, -1, "You tune the radio station and randomly come upon this.");
                PlayAudioStreamForPlayer(playerid, "http://orbzgaming.com/RvB%20Song.mp3");
                }



Re: Dialog troubles - TomatoRage - 20.04.2013

Which line is 3997??


Re: Dialog troubles - xXRealLegitXx - 20.04.2013

Quote:
Originally Posted by TomatoRage
Посмотреть сообщение
Which line is 3997??
The top line on this code:

Код:
                case 16:
                {
                SendClientMessage(playerid, -1, "You tune the radio station and randomly come upon this.");
                PlayAudioStreamForPlayer(playerid, "http://orbzgaming.com/RvB%20Song.mp3");
                }
Nevermind, fixed.


Re: Dialog troubles - BigGroter - 20.04.2013

pawn Код:
case 15:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'idobi Radio'");
                PlayAudioStreamForPlayer(playerid, "http://50.117.115.211:80");
                }
Close it!


Re: Dialog troubles - TomatoRage - 20.04.2013

Look at case 15 you opened it { and didn't closed it }


Re: Dialog troubles - Xoomer - 20.04.2013

ok full code is here
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
    {
        if(dialogid == 1)
        {
            switch(listitem)
            {
                case 0:
                {
                SendClientMessage(playerid,-1,"You tune the radio station to 'Power 181'");
                PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002");
                }
                case 1:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Late 90's");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-lite90s.pls");
                }
                case 2:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Late 80's");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-lite80s.pls");
                }
                case 3:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Kickin' Country'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-kickincountry.pls");
                }
                case 4:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Highway 181'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-highway.pls");
                }
                case 5:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Good Time Oldies'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-goodtime.pls");
                }
                case 6:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Fusion Jazz'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/asx/181-fusionjazz.asx");
                }
                case 7:
                {
                SendClientMessage(playerid, -1, "You tune the radio station 'Rock 181'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-rock.pls");
                }
                case 8:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'The Eagle'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-eagle.pls");
                }
                case 9:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'The Office'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-office.pls");
                }
                case 10:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'True R&B");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-rnb.pls");
                }
                case 11:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Old School Hip Hop'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/asx/181-oldschool");
                }
                case 12:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'True Blues'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/asx/181-blues.asx");
                }
                case 13:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'The Mix'");
                PlayAudioStreamForPlayer(playerid, "http://www.181.fm/stream/pls/181-themix.pls");
                }
                case 14:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'Gay FM'");
                PlayAudioStreamForPlayer(playerid, "http://stream.gayfm.de/");
                }
                case 15:
                {
                SendClientMessage(playerid, -1, "You tune the radio station to 'idobi Radio'");
                PlayAudioStreamForPlayer(playerid, "http://50.117.115.211:80");
                }
                case 16:
                {
                SendClientMessage(playerid, -1, "You tune the radio station and randomly come upon this.");
                PlayAudioStreamForPlayer(playerid, "http://orbzgaming.com/RvB%20Song.mp3");
                }
                case 17:
                {
                SendClientMessage(playerid, -1, "You stop the radio.");
                StopAudioStreamForPlayer(playerid);
                }
            }
        }
        else if(dialogid == 2)
        {
            //Do your code for dialogid 2 here
        }
    }
    return 1;
}