//We use the line above to make the Dialog show, and as you notice we want DIALOG_STYLE_LIST because it will be a list so we can choose from.
//As you notice everytime you add \r\n it adds a new line to the list, which means in our tutorial adds a new radio station to the list.
//Make sure you change the ID of the Dialog, we don't want it to mix with other dialogs in your server, I set it to 90.
return 1;
}
if (strcmp("/vypnoutradio", cmdtext, true, 10) == 0)
{
StopAudioStreamForPlayer(playerid);//This is the function we need to stop the audio from streaming the music.
return 1;
}
return 0;
}
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, 0xFFFFFFFF, "{FF7F00}[ radio ] {FFFFFF}Na serveru je radio by newshift");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 90: //Remember the ID we changed in ShowPlayerDialog? (90) That's how the DialogResponse will get to know which Dialog it's going to use.
{
if(!response)// This one is used for option 2 which we changed to (Cancel).
{
SendClientMessage(playerid, zelena, "vypnul si dialog.");//This one sends a message when you close the dialog using (Cancel).
return 1;
}
switch(listitem)//This one will list the items.
{
{
PlayAudioStreamForPlayer(playerid, "http://icecast3.play.cz/evropa2-128.mp3");//This function will play our desired radio. So we have to put the url between its brackets.
SendClientMessage(playerid, zelena, "Type /vypnoutradio pro vypnuti."); //This line sends a message to the listener that he can stop it using /stopradio.
}
{
PlayAudioStreamForPlayer(playerid, "http://ice2.europa2.sk/fm-europa2sk-128");//This function will play our desired radio. So we have to put the url between its brackets.
SendClientMessage(playerid, zelena, "Type /vypnoutradio pro vypnuti.");//This line sends a message to the listener that he can stop it using /stopradio.
}
{
PlayAudioStreamForPlayer(playerid, "http://ice.abradio.cz:8000/helax128.mp3");//This function will play our desired radio. So we have to put the url between its brackets.
SendClientMessage(playerid, zelena, "Type /vypnoutradio pro vypnuti.");//This line sends a message to the listener that he can stop it using /stopradio.
}
//You can continue cases here but make sure you make a new line in the ShowPlayerDialog on /myradio command \r\n4. 4th \r\n5. 5th channel etc..
Dotaz
newshift 0
Link to comment
Share on other sites
21 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now