Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // mp3 thingy with headphones object on player head...
- // By Charlie Sanchez !
- #include <a_samp>
- #include <zcmd>
- #define PASFP PlayAudioStreamForPlayer
- #define SASFP StopAudioStreamForPlayer
- //-------- MP3 Dialog-------//
- #define DIALOG_MP3 21
- #define COLOR_RED 0xA10000AA
- #define COLOR_GREY 0xAFAFAFAA
- //----------MP3 player--------//
- new Mp3Status[MAX_PLAYERS]; // Variable that is gonna hold the mp3 status.
- CMD:mp3(playerid, params[])
- {
- if(IsPlayerConnected(playerid))
- {
- SendClientMessage(playerid, COLOR_RED, "URL's must end in .mp3 / .pls");
- SendClientMessage(playerid, COLOR_GREY, "[Usage:] /mp3off to remove headphones and stop the player");
- Mp3Status[playerid] = 1;
- ShowPlayerDialog(playerid, DIALOG_MP3, DIALOG_STYLE_INPUT, "MP3 /Radio Player", "Insert MP3/Radio URL here", "Play", "Cancel");
- SetPlayerAttachedObject(playerid, 4, 19421, 2, 0.050000, -0.014999, 0.000000, 95.000000, 183.000000, 89.000000, 1, 1, 1, 0xffffffff);
- //new sendername[MAX_PLAYER_NAME], string[200];
- //GetPlayerName(playerid, sendername, sizeof(sendername));
- //sendername[strfind(sendername,"_")] = ' ';
- //format(string, sizeof(string), "*%s reaches for the mp3/radio player switches it on, and puts the headphones on.", sendername);
- //ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- return 1;
- }
- CMD:mp3off(playerid, params[])
- {
- if(Mp3Status[playerid] == 1)
- {
- //new sendername[MAX_PLAYER_NAME], string[200];
- //GetPlayerName(playerid, sendername, sizeof(sendername));
- //sendername[strfind(sendername,"_")] = ' ';
- //format(string, sizeof(string), "*%s reaches for the mp3/radio player switches it off, and takes the headphones off.", sendername);
- //ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- Mp3Status[playerid] = 0;
- RemovePlayerAttachedObject(playerid, 4);
- SASFP(playerid);
- return 1;
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_MP3)
- {
- PlayAudioStreamForPlayer(playerid, inputtext);
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment