09.03.2013, 16:59
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:
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.
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
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; }
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; }
However, when the option is selected ingame, this does not happen. I need some help.
- Jason