[FilterScript] Simple Mp3 Player in dialogs with Headphones Object.
#1

Hello this is my second release, it is a very simple Mp3 player that uses dialogs and also attaches the headphones object on to the players head has only 2 commands very simple and might inspire some people to improve i dont know but here it is ! so i apreciate contructive comments please and thank you for reading.
MP3 Player in dialogs with Headphones object :



Code:
// 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;
}
Script requires, zcmd include, and if you wish to use the roleplay action messages you must implement proximity detector however it works as it is without Rp messages.!

Dowload links (mediafire):
http://www.mediafire.com/download/es...MP3_Player.rar
Pastebin links :
http://pastebin.com/qrztxtku
Reply
#2

Pretty cool. Might use this if that's alright with you? (because of the cool headphone object!)
Reply
#3

Quote:
Originally Posted by APEXGames
View Post
Pretty cool. Might use this if that's alright with you? (because of the cool headphone object!)
Please do! Use it edit it the way you need!! And thanks for testing! Cheers
Reply
#4

A simple system but it works.
Reply
#5

Quote:
Originally Posted by APEXGames
View Post
Pretty cool. Might use this if that's alright with you? (because of the cool headphone object!)
Thank you.

Quote:
Originally Posted by Hwang
View Post
A simple system but it works.
Thank you.
Reply
#6

now thats call a decent radio system.. best one.. its best coz of the headphones.. well can u add other clothing item too like guitar? n boom bo? i saw it on other server.. well it d be too awesome if u add that.. but still its the best one... ^_^ +repf or u dude
Reply
#7

Nice
Reply
#8

Looks cool. Good job.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)