In Game Stream(Music) Compiling Help -
Spazz1219 - 05.11.2013
SAMProductions did a great job helping me! Thats why he is on the Script!
Anyways, this is a very simple script, /radio to open the dialog /radiooff to turn off streaming.
Need to add a station? should be a simple concept, just copy the strings and add extra dialog options/IDS, if adding a genre!
Код:
//On player/in car radio stations usable by command in a dialog
//Created by BrianSherbino(2013)
//Revised by SAMProductions
//v 0.1
#include <a_samp>
#include <zcmd>
#pragma tabsize 0
#define FILTERSCIPT
#define DIALOG_RADIO 0
#define DIALOG_RADIO2 1
#define DIALOG_RADIO3 2
#define DIALOG_RADIO4 3
#define DIALOG_RADIO5 4
#define COLOR_WHITE 0xFFFFFF00
CMD:radio(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOG_RADIO, DIALOG_STYLE_LIST, "Please pick a Music Genre:", "{C9C800}Dubstep\n{C9C800}Metal\n{C9C800}Pop\n{C9C800}Rock", "OK", "Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_RADIO)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, DIALOG_RADIO2, DIALOG_STYLE_LIST, "These are the Dubstep Radio Stations:", "{C9C800}Dubstep Forward\n{C9C800}Dupstep Beyond", "Play", "Cancel");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, DIALOG_RADIO3, DIALOG_STYLE_LIST, "These are the Metal Radio Stations:", "{C9C800}Idobi Howl\n{C9C800}KNAC.COM", "Play", "Cancel");
}
if(listitem == 2)
{
ShowPlayerDialog(playerid, DIALOG_RADIO4, DIALOG_STYLE_LIST, "These are the Pop Radio Stations:", "{C9C800}100Hitz-Top 40\n{C9C800}181.FM POP", "Play", "Cancel");
}
if(listitem == 3)
{
ShowPlayerDialog(playerid, DIALOG_RADIO5, DIALOG_STYLE_LIST, "These are the Rock Radio Stations:", "{C9C800}181.FM ROCK\n{C9C800}181.FM 80's", "Play", "Cancel");
}
}
}
if(dialogid == DIALOG_RADIO2)
{
if(response)
{
if(listitem == 0)
{
//Dubstep Station 1
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=149515", 0,0,0,0,0);
SendClientMessage(playerid, COLOR_WHITE, "Dubstep Station: Dubstep Forward will now play.");
}
if(listitem == 1)
{
//Dubstep Station 2
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=127336", 0,0,0,0,0);
SendClientMessage(playerid, COLOR_WHITE, "Dubstep Station: Dubstep Beyond will now play.");
}
}
}
if(dialogid == DIALOG_RADIO3)
{
if(response)
{
if(listitem == 0)
{
//Metal Station 1
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=15810", 0,0,0,0,0);
SendClientMessage(playerid, COLOR_WHITE, "Metal Station: Idobi Howl will now play.");
}
if(listitem ==1)
{
//Metal Station 2
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=150273", 0,0,0,0,0);
SendClientMessage(playerid, COLOR_WHITE, "Metal Station: KNAC.COM will now play.");
}
}
}
if(dialogid == DIALOG_RADIO4)
{
if(response)
{
if(listitem == 0)
{
//Pop Station 1
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=59205", 0,0,0,0,0);
SendClientMessage(playerid, COLOR_WHITE, "Pop Station: 100Hitz-Top 40 will now play.");
}
if(listitem == 1)
{
//Pop Station 2
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=611786", 0,0,0,0,0);
SendClientMessage(playerid, COLOR_WHITE, "Pop Station: 181.FM POP will now play.");
}
}
}
if(dialogid == DIALOG_RADIO5)
{
if(response)
{
if(listitem == 0)
{
//Rock Station 1
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=55402", 0,0,0,0,0);
SendClientMessage(playerid, COLOR_WHITE, "Rock Station: 181.FM ROCK will now play.");
}
if(listitem == 1)
{
//Rock Station 2
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=277192", 0,0,0,0,0);
SendClientMessage(playerid, COLOR_WHITE, "Rock Station: 181.FM 80's will now play.");
}
}
}
return 1;
}
CMD:radiooff(playerid, params[])
{
StopAudioStreamForPlayer(playerid);
return 1;
}
Re: In Game Stream(Music) Compiling Help -
hewittpro - 05.11.2013
Post Line 80
Re: In Game Stream(Music) Compiling Help -
SAMProductions - 05.11.2013
What or Where is Line 80, Please Post it, so we're able to help you
Re: In Game Stream(Music) Compiling Help -
SAMProductions - 05.11.2013
FIXED CODE; (You missed some Commas, and Forgot 1 Closing Brackets)
Try This,
pawn Код:
//On player/in car radio stations usable by command in a dialog
//Created by BrianSherbino(2013)
//v 0.1
#include <a_samp>
#include <zcmd>
#pragma tabsize 0
#define FILTERSCIPT
#define DIALOG_RADIO 0
#define DIALOG_RADIO2 1
#define DIALOG_RADIO3 2
#define DIALOG_RADIO4 3
#define DIALOG_RADIO5 4
#define COLOR_WHITE 0xFFFFFF00
CMD:radio(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOG_RADIO, DIALOG_STYLE_LIST, "Please pick a Music Genre:", "{C9C800}Dubstep\n{C9C800}Metal\n{C9C800}Pop\n{C9C800}Rock", "OK", "Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_RADIO)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, DIALOG_RADIO2, DIALOG_STYLE_LIST, "These are the Dubstep Radio Stations:", "{C9C800}Dubstep FM\n{C9C800}Dupstep Beyond", "Play", "Cancel");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, DIALOG_RADIO3, DIALOG_STYLE_LIST, "These are the Metal Radio Stations:", "{C9C800}Idobi Howl\n{C9C800}KNAC.COM", "Play", "Cancel");
}
if(listitem == 2)
{
ShowPlayerDialog(playerid, DIALOG_RADIO4, DIALOG_STYLE_LIST, "These are the Pop Radio Stations:", "{C9C800}100Hitz-Top 40\n{C9C800}181.FM POP", "Play", "Cancel");
}
if(listitem == 3)
{
ShowPlayerDialog(playerid, DIALOG_RADIO5, DIALOG_STYLE_LIST, "These are the Rock Radio Stations:", "{C9C800}181.FM ROCK\n{C9C800}181.FM 80's", "Play", "Cancel");
}
}
}
if(dialogid == DIALOG_RADIO2)
{
if(response)
{
if(listitem == 0)
{
//Dubstep Station 1
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=558051", 0,0,0,1,1);
SendClientMessage(playerid, COLOR_WHITE, "Dubstep Station: Dubstep FM will now play.");
}
if(listitem == 1)
{
//Dubstep Station 2
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=127336", 0,0,0,1,1);
SendClientMessage(playerid, COLOR_WHITE, "Dubstep Station: Dubstep Beyond will now play.");
}
}
}
if(dialogid == DIALOG_RADIO3)
{
if(response)
{
if(listitem == 0)
{
//Metal Station 1
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=15810", 0,0,0,1,1);
SendClientMessage(playerid, COLOR_WHITE, "Metal Station: Idobi Howl will now play.");
}
if(listitem ==1)
{
//Metal Station 2
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=150273", 0,0,0,1,1);
SendClientMessage(playerid, COLOR_WHITE, "Metal Station: KNAC.COM will now play.");
}
}
}
if(dialogid == DIALOG_RADIO4)
{
if(response)
{
if(listitem == 0)
{
//Pop Station 1
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=59205", 0,0,0,1,1);
SendClientMessage(playerid, COLOR_WHITE, "Pop Station: 100Hitz-Top 40 will now play.");
}
if(listitem == 1)
{
//Pop Station 2
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=611786", 0,0,0,1,1);
SendClientMessage(playerid, COLOR_WHITE, "Pop Station: 181.FM POP will now play.");
}
}
}
if(dialogid == DIALOG_RADIO5)
{
if(response)
{
if(listitem == 0)
{
//Rock Station 1
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=55402", 0,0,0,1,1);
SendClientMessage(playerid, COLOR_WHITE, "Rock Station: 181.FM ROCK will now play.");
}
if(listitem == 1)
{
//Rock Station 2
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=277192", 0,0,0,1,1);
SendClientMessage(playerid, COLOR_WHITE, "Rock Station: 181.FM 80's will now play.");
}
}
}
return 1;
}
or
Pastebin for [FIXED] In Game Stream (Music) Compiling Help
Re: In Game Stream(Music) Compiling Help -
HyperZ - 05.11.2013
You were missing some commas.
Fixed:
pawn Код:
//On player/in car radio stations usable by command in a dialog
//Created by BrianSherbino(2013)
//v 0.1
#include <a_samp>
#include <zcmd>
#pragma tabsize 0
#define FILTERSCIPT
#define DIALOG_RADIO 0
#define DIALOG_RADIO2 1
#define DIALOG_RADIO3 2
#define DIALOG_RADIO4 3
#define DIALOG_RADIO5 4
#define COLOR_WHITE 0xFFFFFF00
CMD:radio(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOG_RADIO, DIALOG_STYLE_LIST, "Please pick a Music Genre:", "{C9C800}Dubstep\n{C9C800}Metal\n{C9C800}Pop\n{C9C800}Rock", "OK", "Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_RADIO)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, DIALOG_RADIO2, DIALOG_STYLE_LIST, "These are the Dubstep Radio Stations:", "{C9C800}Dubstep FM\n{C9C800}Dupstep Beyond", "Play", "Cancel");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, DIALOG_RADIO3, DIALOG_STYLE_LIST, "These are the Metal Radio Stations:", "{C9C800}Idobi Howl\n{C9C800}KNAC.COM", "Play", "Cancel");
}
if(listitem == 2)
{
ShowPlayerDialog(playerid, DIALOG_RADIO4, DIALOG_STYLE_LIST, "These are the Pop Radio Stations:", "{C9C800}100Hitz-Top 40\n{C9C800}181.FM POP", "Play", "Cancel");
}
if(listitem == 3)
{
ShowPlayerDialog(playerid, DIALOG_RADIO5, DIALOG_STYLE_LIST, "These are the Rock Radio Stations:", "{C9C800}181.FM ROCK\n{C9C800}181.FM 80's", "Play", "Cancel");
}
}
}
if(dialogid == DIALOG_RADIO2)
{
if(response)
{
if(listitem == 0)
{
//Dubstep Station 1
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=558051", 0,0,0,1,1);
SendClientMessage(playerid, COLOR_WHITE, "Dubstep Station: Dubstep FM will now play.");
}
if(listitem == 1)
{
//Dubstep Station 2
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=127336", 0,0,0,1,1);
SendClientMessage(playerid, COLOR_WHITE, "Dubstep Station: Dubstep Beyond will now play.");
}
}
}
if(dialogid == DIALOG_RADIO3)
{
if(response)
{
if(listitem == 0)
{
//Metal Station 1
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=15810", 0,0,0,1,1);
SendClientMessage(playerid, COLOR_WHITE, "Metal Station: Idobi Howl will now play.");
}
if(listitem ==1)
{
//Metal Station 2
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=150273", 0,0,0,1,1);
SendClientMessage(playerid, COLOR_WHITE, "Metal Station: KNAC.COM will now play.");
}
}
}
if(dialogid == DIALOG_RADIO4)
{
if(response)
{
if(listitem == 0)
{
//Pop Station 1
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=59205", 0,0,0,1,1);
SendClientMessage(playerid, COLOR_WHITE, "Pop Station: 100Hitz-Top 40 will now play.");
}
if(listitem == 1)
{
//Pop Station 2
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=611786", 0,0,0,1,1);
SendClientMessage(playerid, COLOR_WHITE, "Pop Station: 181.FM POP will now play.");
}
}
}
if(dialogid == DIALOG_RADIO5)
{
if(response)
{
if(listitem == 0)
{
//Rock Station 1
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=55402", 0,0,0,1,1);
SendClientMessage(playerid, COLOR_WHITE, "Rock Station: 181.FM ROCK will now play.");
}
if(listitem == 1)
{
//Rock Station 2
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=277192", 0,0,0,1,1);
SendClientMessage(playerid, COLOR_WHITE, "Rock Station: 181.FM 80's will now play.");
}
}
}
return 1;
}
Re: In Game Stream(Music) Compiling Help -
Spazz1219 - 05.11.2013
Thanks SAMProductions, you are in the script, and everyone else, go ahead and use it, see if it works, if not comment and i'll fix it later!