Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Radio system - www.forum.sa-mp.com
- // Member ForumSAMP: www.forum.sa-mp.com/member.php?u=205879
- //********includes*********
- #include <a_samp>
- #pragma tabsize 0
- //******defines************
- #define COLOR_AZUL 0x0000FFAA
- #define COLOR_ROJO 0xFF0000AA
- #define COLOR_BLANCO 0xFFFFFFAA
- //******news*****************
- new static autoradio[MAX_PLAYERS]=0;//0 apagado, 1 Cadena Ser, 2 Rock, 3 Europe FM, 4 reggae, 5 electrónica
- //---------------------------------
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Radio system - ForumSAMP");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmdtext, "/radio", true) == 0)
- {
- new estadojugador = GetPlayerState(playerid);
- if(estadojugador == PLAYER_STATE_DRIVER)
- {
- ShowPlayerDialog( playerid, 100, DIALOG_STYLE_LIST, "STEREO FOX", "Cadena Ser\nRock\nEurope FM\nReggae\nElectronica\nRadio OFF", "Accept", "Cancel" );
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ROJO, "You must be in a vehicle");
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- if(autoradio[playerid]==1)
- {
- StopAudioStreamForPlayer(playerid); PlayAudioStreamForPlayer(playerid, "http://cadenaser.radio.fr/#%2Fhome.jsf");
- SendClientMessage(playerid, COLOR_BLANCO, "You are listening {00FF7F}Cadena Ser - España");
- SendClientMessage(playerid, COLOR_BLANCO, "{FFFF00}/autoradio {FFFFFF}to stop or change");
- }
- if(autoradio[playerid]==2)
- {
- StopAudioStreamForPlayer(playerid); PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=35999");
- SendClientMessage(playerid, COLOR_BLANCO, "You are listening {00FF7F}Rock Internacional FM");
- SendClientMessage(playerid, COLOR_BLANCO, "{FFFF00}/autoradio {FFFFFF}to stop or change");
- }
- if(autoradio[playerid]==3)
- {
- StopAudioStreamForPlayer(playerid); PlayAudioStreamForPlayer(playerid, "http://europafm.radio.fr/");
- SendClientMessage(playerid, COLOR_BLANCO, "You are listening {00FF7F}Europe FM");
- SendClientMessage(playerid, COLOR_BLANCO, "{FFFF00}/autoradio {FFFFFF}to stop or change");
- }
- if(autoradio[playerid]==4)
- {
- StopAudioStreamForPlayer(playerid); PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=9815");
- SendClientMessage(playerid, COLOR_BLANCO, "You are listening {00FF7F}Reggae - Estilo y vida");
- SendClientMessage(playerid, COLOR_BLANCO, "{FFFF00}/autoradio {FFFFFF}to stop or change");
- }
- if(autoradio[playerid]==5)
- {
- StopAudioStreamForPlayer(playerid); PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=108251");
- SendClientMessage(playerid, COLOR_BLANCO, "You are listening {00FF7F}Electronina - Techno - Dubstep FM");
- SendClientMessage(playerid, COLOR_BLANCO, "{FFFF00}/autoradio {FFFFFF}to stop or change");
- }
- if(autoradio[playerid]==0)
- {
- SendClientMessage(playerid, COLOR_BLANCO, "Radio {00FF7F}off");
- SendClientMessage(playerid, COLOR_BLANCO, "{FFFF00}/autoradio {FFFFFF}to ignite");
- }
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- if(autoradio[playerid]==0)
- {
- }
- else
- {
- StopAudioStreamForPlayer(playerid);
- }
- return 1;
- }
- public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[] )
- {
- if (response == 1)
- {
- switch ( dialogid )
- {
- case 100 :
- {
- if ( listitem == 0 )
- {
- StopAudioStreamForPlayer(playerid); PlayAudioStreamForPlayer(playerid, "http://cadenaser.radio.fr/#%2Fhome.jsf");
- SendClientMessage(playerid, COLOR_BLANCO, "Estás escuchando {00FF7F}Reggaeton");
- SendClientMessage(playerid, COLOR_BLANCO, "{FFFF00}/autoradio {FFFFFF}para parar o cambiar");
- autoradio[playerid]=1;
- }
- if ( listitem == 1 )
- {
- StopAudioStreamForPlayer(playerid); PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=35999");
- SendClientMessage(playerid, COLOR_BLANCO, "Estás escuchando {00FF7F}Rock");
- SendClientMessage(playerid, COLOR_BLANCO, "{FFFF00}/autoradio {FFFFFF}para parar o cambiar");
- autoradio[playerid]=2;
- }
- if ( listitem == 2 )
- {
- StopAudioStreamForPlayer(playerid); PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=155534");
- SendClientMessage(playerid, COLOR_BLANCO, "Estás escuchando {00FF7F}Pop Rock");
- SendClientMessage(playerid, COLOR_BLANCO, "{FFFF00}/autoradio {FFFFFF}para parar o cambiar");
- autoradio[playerid]=3;
- }
- if ( listitem == 3 )
- {
- StopAudioStreamForPlayer(playerid); PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=9815");
- SendClientMessage(playerid, COLOR_BLANCO, "Estás escuchando {00FF7F}Reggae");
- SendClientMessage(playerid, COLOR_BLANCO, "{FFFF00}/autoradio {FFFFFF}para parar o cambiar");
- autoradio[playerid]=4;
- }
- if ( listitem == 4 )
- {
- StopAudioStreamForPlayer(playerid); PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=108251");
- SendClientMessage(playerid, COLOR_BLANCO, "Estás escuchando {00FF7F}Electronica");
- SendClientMessage(playerid, COLOR_BLANCO, "{FFFF00}/autoradio {FFFFFF}para parar o cambiar");
- autoradio[playerid]=5;
- }
- if ( listitem == 5 )
- {
- StopAudioStreamForPlayer(playerid);
- SendClientMessage(playerid, COLOR_BLANCO, "Radio {00FF7F}Apagada");
- SendClientMessage(playerid, COLOR_BLANCO, "{FFFF00}/autoradio {FFFFFF}para encender");
- autoradio[playerid]=0;
- }
- }
- }
- }
- else
- {
- switch ( dialogid )
- {
- case 100 :
- {
- StopAudioStreamForPlayer(playerid);
- SendClientMessage(playerid, COLOR_AZUL, "Radio {00FF7F}off.");
- autoradio[playerid]=0;
- return 1;
- }
- }
- }
- return 0;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- autoradio[playerid]=0;
- return 1;
- }
- // www.FORUM.SA-MP.com
Advertisement
Add Comment
Please, Sign In to add comment