搜索
楼主: feikof97

[重要] 死后播放音乐的插件

[复制链接]
发表于 2003-11-22 17:51:08 | 显示全部楼层 来自 中国–广东–深圳–宝安区
MP3 v1.0Beta - Steam only[/size:5f39017f93]
Play MP3's on your clients.
Usage:
amx_playmp3 <mp3file> - Plays a MP3 file on the client
amx_repeatmp3 <mp3file> - Repeats a MP3 file on the client
amx_stopmp3 - Stop all MP3's

File options:
[color=darkblue:5f39017f93]- Play one of the 27 buildin MP3's[/color:5f39017f93]
[color=darkblue:5f39017f93]- Offer a package with optional MP3's on your clansite[/color:5f39017f93]
(Server will not undertake action when not present)
[color=red:5f39017f93]- Precache them*[/color:5f39017f93]

This is my first plugin, based on a few others. It isn't amazing but it could add a nice ambience to a game.

- Buildin MP3's list

* [b:5f39017f93]IMPORTANT[/b:5f39017f93]: You will need to remove the three lines above "public plugin_precache()" and the "*/" under } to enable Precaching of MP3 files.
This has [b:5f39017f93]NOT[/b:5f39017f93] been tested.
[amxcode:1:5f39017f93]
/*__  __ ___ ____      _   __  _     
*|  \/  | _ \__ / __ _/ | /  \| |__
*| |\/| |  _/|_ \ \ V / || () | '_ \
*|_|  |_|_| |___/  \_/|_(_)__/|_.__/
*                                    
* MP3 v1.0Beta - Steam
* This file is provided as is (no warranties).
*
* Play MP3's on your clients.
* Usage:
* amx_playmp3 <mp3file> - Plays a MP3 file on the client
* amx_repeatmp3 <mp3file> - Repeats a MP3 file on the client
* amx_stopmp3 - Stop all MP3's
*
* The MP3 player will look for it's files in ModDir\valve\
*
* IMPORTANT: You will need to remove the three lines above "public plugin_precache()"
* and the line under under } in that block to enable Precaching of MP3 files.
* (Not tested yet)
*
* There allready a few MP3's in your HL, which will be listed in the thread also.
* (No precache required at all)
*/

#include <amxmod>
#include <amxmisc>

public admin_playmp3(id,level,cid) {
   if (!cmd_access(id,level,cid,2))
      return PLUGIN_HANDLED
   new mp3var[1024]
   read_argv(1,mp3var,1023)
   client_cmd(0,"echo ^"Playing MP3.. Type mp3 stop to stop it.^";mp3 play ^"%s^"",mp3var)
   return PLUGIN_HANDLED
}

public admin_loopmp3(id,level,cid) {
   if (!cmd_access(id,level,cid,2))
      return PLUGIN_HANDLED
   new mp3loopvar[1024]
   read_argv(1,mp3loopvar,1023)
   client_cmd(0,"echo ^"Playing MP3 with Repeat on.. Type mp3 stop to stop it.^";mp3 loop ^"%s^"",mp3loopvar)
   return PLUGIN_HANDLED
}

public admin_stopmp3(id,level,cid) {
   client_cmd(0,"echo ^"MP3 disabled..^";mp3 stop")
   return PLUGIN_HANDLED
}

/*
*  Precache - Just replace the filenames but keep in mind
*  the mp3 player only has access to ModDir/valve/
public plugin_precache()
{   
  precache_model("valve/media/Britney.mp3")
  precache_model("valve/media/Shakira.mp3")
}
*/

public plugin_init(){
   register_plugin("MP3","1.0b","DutchTiger")
   register_concmd("amx_mp3","admin_playmp3",ADMIN_LEVEL_A,"mp3 - Play a MP3 on their computer")
   register_concmd("amx_repeatmp3","admin_loopmp3",ADMIN_LEVEL_A,"mp3 - Repeat a MP3 on their computer")
   register_concmd("amx_stopmp3","admin_stopmp3",ADMIN_LEVEL_A,"Stops ALL MP3 files playing.")
   return PLUGIN_CONTINUE
}
回复

使用道具 举报

发表于 2003-11-22 17:52:19 | 显示全部楼层 来自 中国–广东–深圳–宝安区
我英文差不知是不是上面那个在AMX官方论坛找的。
回复

使用道具 举报

发表于 2003-11-23 04:00:45 | 显示全部楼层 来自 中国–广东–深圳–罗湖区
就是这个

怎么加载,一起试试吧
回复

使用道具 举报

发表于 2003-11-23 18:19:05 | 显示全部楼层 来自 日本

一起看吧!

一起看吧!我也想要!高手解决把!顶!
回复

使用道具 举报

发表于 2003-11-23 18:25:26 | 显示全部楼层 来自 中国–广东–深圳–宝安区
如果是这个要编绎一下成amx文件就可以用啦。
回复

使用道具 举报

发表于 2003-11-24 01:20:32 | 显示全部楼层 来自 中国–北京–北京
有谁试过了没有?  可以达到死后播放音乐的效果吗?
回复

使用道具 举报

发表于 2003-11-24 01:29:41 | 显示全部楼层 来自 中国–四川–南充

!!!!!!!!!!!!!!!!!!

有没有结果了!?????????

哥哥们,,,,,,,,,我等得花儿都谢了!!!!!!!!!!
回复

使用道具 举报

发表于 2003-11-25 00:23:43 | 显示全部楼层 来自 中国–辽宁–沈阳
这个我实验过,不是死后听的,是OP控制服务器听的,而且还不怎么地~~~
回复

使用道具 举报

发表于 2003-11-25 11:47:51 | 显示全部楼层 来自 中国–四川–成都
是呀
有东东就好。。。
回复

使用道具 举报

发表于 2003-11-25 12:02:24 | 显示全部楼层 来自 中国–湖北–武汉
晕倒。。。偶属于初级op啦,还没有编译AMX的能力,偶还是等着哪位高手的成功吧,不过不要说偶什么都没做只会拿现成的。。偶可是精神支持你们啊 :P (脑力脑动也很累的啦 ^_^)。。顶。。。。
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表