Dialog troubles -
xXRealLegitXx - 09.03.2013
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
Respuesta: Dialog troubles -
Parka - 09.03.2013
recalls that the links should be .mp3
Re: Respuesta: Dialog troubles -
xXRealLegitXx - 09.03.2013
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...
Re: Dialog troubles -
MP2 - 09.03.2013
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).
Re: Dialog troubles -
xXRealLegitXx - 09.03.2013
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.
Re: Dialog troubles -
xXRealLegitXx - 10.03.2013
Bump - Really need an answer for this
Re: Dialog troubles -
xXRealLegitXx - 11.03.2013
Bump - Last time I am trying this.