|
Senior Member
Join Date: Aug 2010
Location: Moscow, Russia
|
07-23-2011
, 04:30
Re: Music . MP3 Player!
|
#24
|
Quote:
Originally Posted by 2reason2kill
I made it But I dont know if it will work.
Make A Folder in your sound that called Song then put ur song there.
You need to rename them to song1 song2 and song3.
If you want more tell me.
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Mp3 Player!"
#define VERSION "1.0"
#define AUTHOR "2Reason2kill"
new song1 [ ] = "sound/song/song1"
new song2 [ ] = "sound/song/song2"
new song3 [ ] = "sound/song/song3"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /music","Musicmenu")
register_clcmd("say /Stop","Stopmusic")
}
public plugin_precache( )
{
precache_generic( song1 );
precache_generic( song2 );
precache_generic( song3 );
}
public Stopmusic(id)
{
client_cmd(id, "Mp3 stop")
}
public Musicmenu(id)
{
new Music = menu_create( "\w Wich Song Do you want?","Playmusic")
menu_additem(Music ,"song1", "1", 0)
menu_additem(Music ,"song2", "2", 0)
menu_additem(Music ,"song3", "3", 0)
menu_setprop(Music, MPROP_PERPAGE, 0);
menu_display(id, Music);
}
public Playmusic(id, Music, item )
{
if( item == MENU_EXIT )
{
menu_destroy ( Music )
return PLUGIN_HANDLED
}
new data[ 6 ], iName[ 64 ]
new access, callback
menu_item_getinfo( Music, item, access, data, 5, iName, 63, callback )
new key = str_to_num( data )
switch (key)
{
case 1:
{
client_cmd( id, "mp3 play ^"%s^"", song1);
}
case 2:
{
client_cmd( id, "mp3 play ^"%s^"", song2);
}
case 3:
{
client_cmd( id, "mp3 play ^"%s^"", song3);
}
}
menu_destroy(Music)
return PLUGIN_HANDLED
}
|
Hello.
Is it possbile to make plugin detect all .mp3 files in directory /sound/Song and make a list of it.
If it`s not possible, maybe give possibility for player to write name of the Song himself? I mean, that the player will play the song name, which player type.
|
|
|
|