Dialog troubles
#1

I created a dialog to play a shoutcast radio. Easy? Yes. However, it seems that whenever I click an option, it doesn't respond.

This is the command that brings up the dialog:
Код:
CMD:cradio(playerid, params[])
{
    new option[20];
    if(isnull(params))
    {
        return SendClientMessage(playerid, -1, "USAGE: /cradio station");
    }
    if(!strcmp(option, "station", true))
    if(!IsPlayerInAnyVehicle(playerid)) return 0;
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Radio Stations", "Power 181", "Select", "Cancel");
    return 1;
}
I created an option called "Station" for the command, it is simply so their can be a space. and in the future, more options will most probably be added.

The dialog is a list that is coded to bring up "Power 181" and the buttons "Select" and "Cancel"

Easy. But now I need to add a response.

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(dialogid == 1)
	{
		if(response)
		{
			if(listitem == 0)
			{
			PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002");
 			}
		}
	}
  return 1;
}
This creates a response. Since only one option is a available, only one response is listed. When this response is selected, it will play a shoutcast audio stream for the player.

However, when the option is selected ingame, this does not happen. I need some help.

- Jason
Reply
#2

recalls that the links should be .mp3
Reply
#3

Quote:
Originally Posted by cesar_******
Посмотреть сообщение
recalls that the links should be .mp3
EVERY Dialog I have EVERY tried doesn't work.

And I put that same function into a command called /power181 and it works...
Reply
#4

Never use literal IDs for dialogs. Define them. But yeah, your problem is that you need to link to a FILE, not just an IP!

You need a .pls file (playlist).
Reply
#5

Quote:
Originally Posted by MP2
Посмотреть сообщение
Never use literal IDs for dialogs. Define them. But yeah, your problem is that you need to link to a FILE, not just an IP!

You need a .pls file (playlist).
As I stated before, I implemented a shoutcast link into a command called /power181. It doesn't matter, I even tried to convert and it still didn't work.
Reply
#6

Bump - Really need an answer for this
Reply
#7

Bump - Last time I am trying this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)