|
发表于 2020-8-8 10:51:48
|
显示全部楼层
来自 中国–香港
本帖最后由 375904504 于 2020-8-8 11:07 编辑
简简单单写个例子,尝试编译和测试,如果有想法或不懂就加我QQ 375904504
- #include <amxmodx>
- #include <amxmisc>
- #include <colorchat>
- public plugin_init()
- {
- register_plugin("ServerMisc","0.1","paslalala")
- register_clcmd("say /play" ,"Server_Play");
- register_clcmd("say /stop" ,"Stop_Play");
- }
- public plugin_precache()
- {
- //emmm.. 自己写要下载的mp3
- }
- public Server_Play(id)
- {
- if(!(get_user_flags(id) & ADMIN_KICK))//权限自己写
- {
- return PLUGIN_HANLED;
- }
- client_cmd(0,"mp3 loop 音频文件及路径.mp3")
- new name[32];
- get_user_name(id,name,charsmax(name));
- ColorChat(id,RED,^4%s ^1播放了一首音乐,如果你想停止请在控制台输入'^3mp3 stop^1'",name);
- return PLUGIN_HANDLED;
- }
- public Stop_Play()
- {
- client_cmd(0,"mp3 stop);
- ColorChat(0,RED,"服务器音乐已暂停");
- return PLUGIN_HANDLED;
- }
复制代码 |
|