Radio system
#1

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 ):
Reply
#2

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

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

Use PlayAudioStreamForPlayer.

Maybe using sscanf in a command or in dialogs.
Reply
#5

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;
}
Reply
#6

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");
}
}
}
Reply
#7

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;

Reply
#8

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

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

first of all, i need a tutorial

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


Forum Jump:


Users browsing this thread: 1 Guest(s)