SA-MP Forums Archive
Radio system - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Radio system (/showthread.php?tid=585584)



Radio system - Glossy42O - 15.08.2015

Hey,

Is there any tutorial how to make radio system with url input so i can put every song i want ?

I knew how to do it before till i left learning to script n shit ):


Re: Radio system - Karan007 - 15.08.2015

I think, no tutorial is there to show how to make one. Just ****** searched.


Re: Radio system - Glossy42O - 15.08.2015

I need a tutorial, So i'll know how to make it lol


Re: Radio system - Gammix - 15.08.2015

Use PlayAudioStreamForPlayer.

Maybe using sscanf in a command or in dialogs.


Re: Radio system - itsCody - 15.08.2015

Not sure if this is what you're looking for, but this will play the requested URL for everybody in the server. Would require users being logged into RCON to use it.

pawn Код:
CMD:stream(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return 0;
    if(isnull(params)) return SendClientMessage(playerid, -1, "usage; /stream [url]");
    for(new id = 0; id < MAX_PLAYERS; id++)
    {
        if(!IsPlayerConnected(id)) continue;
        PlayAudioStreamForPlayer(id, params);
    }
    return 1;
}



Re: Radio system - LovelySoomro - 15.08.2015

dcmd_radio(playerid,params[])
{
#pragma unused params
if(GetPVarInt(playerid, "health22") == 1)return SendClientMessage(playerid,-1,"{FF0000}[NGP]: you cannot use cmds while you in a fight or lossing health!");
if(AccInfo[playerid][Jailed] == 1)return SendClientMessage(playerid,red,"[NGP]: You cannot use this command in jail!");
ShowPlayerDialog(playerid,DIALOGID+192,DIALOG_STYL E_LIST,"Pick your Channel/Song","Miley Cyrus - adore you\nInna Crazy Sexy Wild\nEminem - Rap God\nMonster Eminem ft Rihanna\nMiley Cyrus - Wrecking Balls\nHit104 FM\nRadio 538(Dutch Radio Channel)\nNgp Radio\nWildstyles Ft. Niels Geusebroek - Year of Summer\nJumi Ki Raat-Kick\nBhardo Jholi Mere Ya muhammed-bajrangi bhaijaan\nStop Radio", "Select", "Close");
return 1;
}

if (dialogid == 123 && response)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid,Stunt,DIALOG_STYLE_LIST, "{ff4500}Stunt And Maps" ,"{FB0404}BaseJump 1\n{0080FF}Basejump 2\n{00FF40}Pipes\n{FF8000}Drift City\n{FFFF80}Abondonent Stunt\n{0000FF}Jump 3", "SELECT", "EXIT");
}
case 1:
{
ShowPlayerDialog(playerid,Sanandreas,DIALOG_STYLE_ LIST,"{ff4500}Sanandreas" ,"{ffff00}/LV\n{ffff00}/LS\n{ffff00}/SF\n{ffff00}/LC", "SELECT", "EXIT");
}
case 2:
{
ShowPlayerDialog(playerid,Interiors,DIALOG_STYLE_L IST,"{ff4500}Interiors" ,"{FF8000}Michelle\n{ffff00}Katie\n{FF0000}Barbara \n{00FFFF}Helena\n{408080}Millie\n{0080C0}8-Track Stadium\n{00FF00}DirtBike Stadium\n{0000FF}Vice Stadium\n{008040}Madd Dogg,s Mansion", "SELECT", "EXIT");
}
case 3:
{
ShowPlayerDialog(playerid,Freeroam,DIALOG_STYLE_LI ST,"{ff4500}Freeroam" ,"{008040}/Lstune\n{0000FF}/Sftune\n{FF0000}Trucking\n{FF8040}Grove Street\n{0080C0}Vinewood\n{008000}Ls Downtown", "SELECT", "EXIT");
}
}
}


Re: Radio system - jlalt - 15.08.2015

lol :lllll leme teach you
1. make the define and command for show dialog **** if you want it dialog ****
Код:
#define DIALOG_RADIO 3000
now the command:
PHP код:
CMD:radio(playeridparams[])
{
    
ShowPlayerDialog(playeridDIALOG_RADIODIALOG_STYLE_LIST"Welcome to Radio""Song 1 Name\nSong 2 Name\nSong 3 name\nSong 4 Name\nSong 5 Name\nSong 6 Name\n{FF0000}Stop Radio""Select""Cancel");
    return 
1;

now we make the response D:
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
   if(
dialogid == DIALOG_RADIO)
        {
        if(
response)
                {

                        if(
listitem == 0)
                        {
PlayAudioStreamForPlayer(playerid"url");
                        }
                        if(
listitem == 1)
                        {
PlayAudioStreamForPlayer(playerid"url");
                        }
                        if(
listitem == 2)
                        {
PlayAudioStreamForPlayer(playerid"url");
                        }
                        if(
listitem == 3)
                        {
PlayAudioStreamForPlayer(playerid"url");
                        }
                        if(
listitem == 4)
                        {
PlayAudioStreamForPlayer(playerid"url");
                        }
                        if(
listitem == 5)
                        {
PlayAudioStreamForPlayer(playerid"url");
                        }
                        if(
listitem == 6)
                        {
PlayAudioStreamForPlayer(playerid,"Radio Stoped");
                        }
                        return 
1;
           }
   }
   return 
0;




Re: Radio system - LovelySoomro - 15.08.2015

ops i forgot to ad #define DIALOG_RADIO 3000 any way both are works


Re: Radio system - lanix - 15.08.2015

there is tutorial: forum.sa-mp.com/showthread.php?t=301986


Re: Radio system - Glossy42O - 15.08.2015

first of all, i need a tutorial

second, i want a dialog, and u put the link of the song YOU want