Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- |==============================|
- | System Radio by Rochester |
- | Credits: Rochester |
- |==============================|
- */
- #define FILTERSCRIPT
- #include <a_samp>
- new RadioActual[MAX_VEHICLES];
- #define DIALOG_RADIO 1
- public OnFilterScriptInit()
- {
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/carradio", cmdtext, true, 10) == 0)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- new string[50];
- strcat(string, "{F2D068}Asculta {FFFFFF}Pro FM\n");
- strcat(string, "{F2D068}Asculta {FFFFFF}Radio Taraf\n");
- strcat(string, "{FFFFFF}Stop Radio\n");
- ShowPlayerDialog(playerid,DIALOG_RADIO,DIALOG_STYLE_LIST,"Car Radio:", string, "Play", "Cancel");
- }
- return 1;
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(dialogid == DIALOG_RADIO)
- {
- if(response)
- {
- if(listitem == 0)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://stream.profm.ro:8012/profm.mp3");
- RadioActual[vehicleid] = 1;
- return 1;
- }
- if(listitem == 1)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://radiotaraf.no-ip.biz:7100");
- RadioActual[vehicleid] = 2;
- return 1;
- }
- if(listitem == 2)
- {
- StopAudioStreamForPlayer(playerid);
- RadioActual[vehicleid] = 0;
- return 1;
- }
- }
- return 1;
- }
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(newstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_PASSENGER)
- {
- if(RadioActual[vehicleid] == 1)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://stream.profm.ro:8012/profm.mp3");
- }
- else if(RadioActual[vehicleid] == 2)
- {
- StopAudioStreamForPlayer(playerid);
- PlayAudioStreamForPlayer(playerid, "http://radiotaraf.no-ip.biz:7100");
- }
- else if(RadioActual[vehicleid] > 2)
- {
- StopAudioStreamForPlayer(playerid);
- }
- }
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- StopAudioStreamForPlayer(playerid);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement