|
#include <amxmod>
new get_mname[32]
new get_numteam, get_mplayers[32]
public music_showmenu(id){
if (!(is_user_alive(id))){
return PLUGIN_CONTINUE
}
new musicmenu[256]
new get_team[32]
get_user_name(id, get_mname, 31)
get_user_team(id, get_team, 31)
get_players(get_mplayers, get_numteam, "c", get_team)
format(musicmenu,256,"\yMusic Menu: %s^n\w^n1. BGM1^n2. BGM2^n3. BGM3^n4. BGM4^n5. BGM5^n6. STOP^n^n0. Cancel",get_mname)
show_menu(id,(1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9),musicmenu)
return PLUGIN_HANDLED
}
public music_result (mp3file[], printmsg[], id){
new musicmsg[128], mp3exec[1024]
client_cmd(0,"mp3 stop")
format (mp3exec, 1023,"mp3 play media/TR/%s", mp3file) //MP3命令与文件放置地方
client_cmd(0, mp3exec)
format (musicmsg, 127, "%s (MUSIC): %s", get_mname, printmsg)
client_print(0, print_chat, musicmsg)
}
public music_execmenu(id, key){ //MP3文件名与播放信息
switch(key)
{
case 0:
{
music_result ("gas.mp3", "Music Start! (BGM1)", id)
}
case 1:
{
music_result ("PD1.mp3", "Music Start! (BGM2)", id)
}
case 2:
{
music_result ("PD2.mp3", "Music Start! (BGM3)", id)
}
case 3:
{
music_result ("C42.mp3", "Music Start! (BGM4)", id)
}
case 4:
{
music_result ("fam.mp3", "Music Start! (BGM5)", id)
}
case 5:
{
music_result ("", "STOP Music!", id)
}
}
return PLUGIN_HANDLED
}
public plugin_precache(){ //自动上传mp3用
precache_generic("media/TR/gas.mp3")
precache_generic("media/TR/PD1.mp3")
precache_generic("media/TR/PD2.mp3")
precache_generic("media/TR/C42.mp3")
precache_generic("media/TR/fam.mp3")
}
public plugin_init(){
register_plugin("Music Menu","1.22","+ARUKARI-")
register_menucmd(register_menuid("\yMusic Menu: "), 1023, "music_execmenu")
register_clcmd("music","music_showmenu",-1," - shows a menu of a Music commands")
return PLUGIN_CONTINUE
}
此为日本的arukari开发的插件。各位可以参考一下,可使用在amxx下! |
|