16.02.2012, 20:23
So yeah.
Done a lot in my script lately. Now, I am script a MP3 Player streaming into my script.
So I done everything and compiled without any errors but when I am in-game, I do /radio in the vehicle.
It brings up the dialogs and I click on the station but the music doesn't play.
Here are the codes I have.
Is there something wrong in the coding? Please help.
Done a lot in my script lately. Now, I am script a MP3 Player streaming into my script.
So I done everything and compiled without any errors but when I am in-game, I do /radio in the vehicle.
It brings up the dialogs and I click on the station but the music doesn't play.
Here are the codes I have.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_RADIO:
{
if(!response)
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "INFO: You canceled the radio station");
return 1;
}
switch(listitem)
{
case 0:
{
PlayAudioStreamForPlayer(playerid, "http://www.hot108.com/hot108live.html");
SendClientMessage(playerid, COLOR_BRIGHTRED, "INFO: Your vehicle's radio is now playing.");
}
case 1:
{
PlayAudioStreamForPlayer(playerid, "");
SendClientMessage(playerid, COLOR_BRIGHTRED, "INFO: Your vehicle's radio is now playing.");
}
case 2:
{
PlayAudioStreamForPlayer(playerid, "");
SendClientMessage(playerid, COLOR_BRIGHTRED, "INFO: Your vehicle's radio is now playing.");
}
}
}
}
return 1;
}
pawn Код:
//--------------------------------[COMMANDS]------------------------------------
CMD:radio(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, -1, "You need to be in a vehicle to use this command!");
ShowPlayerDialog(playerid, DIALOG_RADIO,DIALOG_STYLE_LIST,"Radio Stations","1. 95.3 FM\r\n2. 92.5 FM\r\n3. 101.1 FM","Select", "Cancel");
return 1;
}
CMD:offradio(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid))
StopAudioStreamForPlayer(playerid);
return 1;
}