Dialog problem
#3

The loop entry has to come before the switch. Only cases can come after the switch is used. Therefore, it should look like this:

pawn Код:
if(dialogid == DIALOG_PLAYLIST)
{
    if(response)
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            switch(listitem)
            {
                case 0: StopAudioStreamForPlayer(i);
                case 1: PlayAudioStreamForPlayer(i, "");
                case 2: PlayAudioStreamForPlayer(i, "");
                case 3: PlayAudioStreamForPlayer(i, "");
                case 4: PlayAudioStreamForPlayer(i, "");
                case 5: PlayAudioStreamForPlayer(i, "");
                case 6: PlayAudioStreamForPlayer(i, "");
                case 7: PlayAudioStreamForPlayer(i, "");
                case 8: PlayAudioStreamForPlayer(i, "");
            }
        }
    }
    else return 0;
}
It's worth noting that instead of using the brackets, if you only have one line of code after a 'case', then you can just it like above and save space. If you have more code, then use brackets and put the code inside.
Reply


Messages In This Thread
Dialog problem - by GGW - 03.08.2014, 12:47
Re: Dialog problem - by IceBilizard - 03.08.2014, 12:57
Re: Dialog problem - by Rifa4life - 03.08.2014, 14:36
Re: Dialog problem - by GGW - 03.08.2014, 21:30

Forum Jump:


Users browsing this thread: 1 Guest(s)