SA-MP Forums Archive
[FilterScript] Easy editable radio script - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Easy editable radio script (/showthread.php?tid=409197)



Easy editable radio script - iGamerX - 20.01.2013

Read first:

This is my first release on Filterscripts selection.I saw some radio scripts but it hard and more things to do on it, so i made a one my self.Must say my brother also helped me to create this script.This is so easy to add some new channels and delete having one's.I Don't get much time tell all about this, i know this is small easy one, nut i done it clearly more good.

How to use:

Just simple steps you have to do.

1.Open your pawno and press "New" button.
2.Copy this whole script and paste it there.
3.Now compile/Run it and save it as any name you want/like, now if it's says this down there.

Quote:

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

That means you are nicely complete it.

4.Now open your server.cfg and put this on line and save it.

Quote:

Filterscripts Radio_Script (it's my FS name, put your FS name there)

5.Now you are done.

Here the script:

Код:
//                . . .=+=+=+=+=+=+=+=+=+=+=+=+= Online Radio script by iGamerX=+=+=+=+=+=+=+=+=+=+=+=+=+=+=. . .

#include <a_samp>

#define FILTERSCRIPT

#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_PINK 0xFFC0CBAA
#define COLOR_RED 0xAA3333AA

public OnFilterScriptInit()
{
        print("\n--------------------------------------");
        print(" Online Radio script by  iGamerX");
        print("--------------------------------------\n");
        return 1;
}

main()
{
        print("\n----------------------------------");
        print(" Online Radio script by iGamerX");
        print("----------------------------------\n");
}

public OnPlayerCommandText(playerid, cmdtext[])
{
        if(strcmp("/Radio", cmdtext, true, 10) == 0)
{
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "~=~=~=~=~=~=~=~=~=~= Radio Channels ~=~=~=~=~=~=~=~=~=~=");
        SendClientMessage(playerid, COLOR_WHITE, "/1 /2 /3 /4 /5 /6 /7 /8 /9 /10 /11 /12 /13 /14 /15");
        SendClientMessage(playerid, COLOR_WHITE, "/16 /17 /18 choose one of them to listen please");
        SendClientMessage(playerid, COLOR_WHITE, "Please use /stopradio to stop the radio");
		SendClientMessage(playerid, COLOR_PINK, "This Online Radio script by iGamerX");//Don't change credites please.
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "~=~=~=~=~=~=~=~=~=~= Radio Channels ~=~=~=~=~=~=~=~=~=~=");
        return 1;
}
        if (strcmp("/Stopradio", cmdtext, true, 10) == 0)
{
        StopAudioStreamForPlayer(playerid);
        SendClientMessage(playerid, 0xAA3333AA, "You have stopped the playing radio. . .");
        return 1;
}

        if (strcmp("/1", cmdtext, true) == 0)
{
        PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=237394");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen /1, Type /stopradio to stop audio streaming.");
        return 1;
}
        if (strcmp("/2", cmdtext, true) == 0)
{
        PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=285516");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen /2, Type /stopradio to stop audio streaming.");
        return 1;
}
        if (strcmp("/3", cmdtext, true) == 0)
{
        PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2187022");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen /3, Type /stopradio to stop audio streaming.");
        return 1;
}
        if (strcmp("/4", cmdtext, true) == 0)
{
        PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377200");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen /4, Type /stopradio to stop audio streaming.");
        return 1;
}
        if (strcmp("/5", cmdtext, true) == 0)
{
        PlayAudioStreamForPlayer(playerid, "http://212.48.110.70:30710");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen /5, Type /stopradio to stop audio streaming.");
        return 1;
}
        if (strcmp("/6", cmdtext, true) == 0)
{
        PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057197");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen /6, Type /stopradio to stop audio streaming.");
        return 1;
}
        if (strcmp("/7", cmdtext, true) == 0)
{
        PlayAudioStreamForPlayer(playerid, "http://scfire-mtc-aa04.stream.aol.com:80/stream/1018");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen /7, Type /stopradio to stop audio streaming.");
        return 1;
}
        if (strcmp("/8", cmdtext, true) == 0)
{
        PlayAudioStreamForPlayer(playerid, "http://techno.fm/radio/techno/?affID=technofm");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen /8, Type /stopradio to stop audio streaming.");
        return 1;
}
        if (strcmp("/9", cmdtext, true) == 0)
{
        PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=13309");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen /9, Type /stopradio to stop audio streaming.");
        return 1;
}
        if (strcmp("/10", cmdtext, true) == 0)
{
        PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1267576");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen /10, Type /stopradio to stop audio streaming.");
        return 1;
}
        if (strcmp("/11", cmdtext, true) == 0)
{
        PlayAudioStreamForPlayer(playerid, "http://80.237.158.76:80");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen /11, Type /stopradio to stop audio streaming.");
        return 1;
}
        if (strcmp("/12", cmdtext, true) == 0)
{
        PlayAudioStreamForPlayer(playerid, "http://173.193.202.125:15236/listen.mp3?authn5d554f84ea9b43d0eca5f44ff9a3ab1a");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen /12, Type /stopradio to stop audio streaming.");
        return 1;
}
        if (strcmp("/13", cmdtext, true) == 0)
{
        PlayAudioStreamForPlayer(playerid, "http://tunein.com/tuner/?StationId=108531&");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen /13, Type /stopradio to stop audio streaming.");
        return 1;
}
        if (strcmp("/14", cmdtext, true) == 0)
{
        PlayAudioStreamForPlayer(playerid, "http://78.159.104.167:80");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen /14, Type /stopradio to stop audio streaming.");
        return 1;
}
        if (strcmp("/15", cmdtext, true) == 0)
{
        PlayAudioStreamForPlayer(playerid, "http://50.117.115.211:80");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen /15, Type /stopradio to stop audio streaming.");
        return 1;
}
        if (strcmp("/16", cmdtext, true) == 0)
{
        PlayAudioStreamForPlayer(playerid, "http://80.237.159.41:7000");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen /16, Type /stopradio to stop audio streaming.");
        return 1;
}
        if (strcmp("/17", cmdtext, true) == 0)
{
        PlayAudioStreamForPlayer(playerid, "http://87.98.131.132:5000");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen /17, Type /stopradio to stop audio streaming.");
        return 1;
}
        if (strcmp("/18", cmdtext, true) == 0)
{
        PlayAudioStreamForPlayer(playerid, "http://78.129.227.10:8000");
        SendClientMessage(playerid, 0xFFFFFFAA, "You have choosen /18, Type /stopradio to stop audio streaming.");
        return 1;
        
        //If you want to add some more just copy a line if to return 1;.
        //You also can change the stations URL and add a another site.
        //You also can change the name of the station Ex: /1 you can change it to /Hip_Hop or something like that.
        //Don't get credits to you.
}
  
        return 0;
}
Thanks for reading and hope you like it!


Re: Easy editable radio script - DiGiTaL_AnGeL - 21.01.2013

Why so many cmds and not params? They are easy to use, search some tutorials, you'll learn fast.


Re: Easy editable radio script - gnoomen2 - 21.01.2013

Or use a dialog


Re: Easy editable radio script - batonsa - 21.01.2013

You could also add onplayerstatechange call so it can be used for vehicles aswell.


Re: Easy editable radio script - Sellize - 21.01.2013

Very well done, repped


Re: Easy editable radio script - Maklister - 21.01.2013

could have done in zcmd, strcmp is just a comparator, since the processor is a zcmd.


Re: Easy editable radio script - iGamerX - 21.01.2013

Thank you all for your advises and comments, yes i know and i am new to scripting part, i will try to make some others as you guys said.