[FilterScript] Simple Radio System! :]
#1

Hey guys!

Today i will be releasing a simple radio System!
Enjoy!


PWN CODE:
Code:
// By AviPeker //
#include <a_samp>
#include <zcmd>

#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_GREEN 0x33AA33AA

#define DIALOG_THERADIO 1

new ifplayerlistening[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    ifplayerlistening[playerid] = 0;
    return 1;
}

CMD:radio(playerid,cmdtext[])
{
    ShowPlayerDialog(playerid, DIALOG_THERADIO, DIALOG_STYLE_LIST, "Radio Stations","Pop\r\nElectro\r\nDubstep\r\nHouse\r\nDJ Music","Listen","Cancel");  // To create more radios [ \r\nElectro ]
    return 1;
}

CMD:stopradio(playerid,cmdtext[])
{
    if(ifplayerlistening[playerid] == 1) 
    {
        StopAudioStreamForPlayer(playerid);
        SendClientMessage(playerid, COLOR_RED, "~You turned your radio off!~");
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "Your radio is already OFF!");
    }
    return 1;
} 

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_THERADIO:
        {
            if(!response)
            {
            }
            if(response)
            {
                switch(listitem)
                {
                    case 0:
                    {
                        ifplayerlistening[playerid] = 1;
                        PlayAudioStreamForPlayer(playerid,"http://RadioUrl.com");  // The Radio Stream URL
                    }
                    case 1: 
                    {
                        ifplayerlistening[playerid] = 1;
                        PlayAudioStreamForPlayer(playerid,"http://RadioUrl.com");
                    }
                    case 2:
                    {
                        ifplayerlistening[playerid] = 1;
                        PlayAudioStreamForPlayer(playerid,"http://RadioUrl.com");
                    }
                    case 3:
                    {
                        ifplayerlistening[playerid] = 1;
                        PlayAudioStreamForPlayer(playerid,"http://RadioUrl.com");
                    }
                    case 4:
                    {
                        ifplayerlistening[playerid] = 1;
                        PlayAudioStreamForPlayer(playerid,"http://RadioUrl.com");
                    }
                }
            }
        }
    }
    return 1;
}
Reply
#2

notbad gonna test it
Reply
#3

Quote:
Originally Posted by Devil123
View Post
notbad gonna test it
Works? :P
Reply
#4

Simple, good.
Reply
#5

ya its work gg
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)