|
本帖最后由 homework 于 2010-11-17 11:13 编辑
此贴问题已修正,详情请看7楼!!!!
先发源码:这个是聊天区域提示版的- /*服务器重起插件。由 by:yzmzx 于08年08月28日修改*/
- #include <amxmodx>
- #include <amxmisc>
- public plugin_init() {
- register_plugin("Server restart", "1.1", "Remo Williams")
- register_concmd("amx_restart","serverrestart",ADMIN_IMMUNITY," - Shuts down server in 10 seconds")
- }
- public plugin_precache(){
- precache_sound( "misc/chongqi.wav")
- return PLUGIN_CONTINUE
- }
- public serverrestart(id) {
- if (!(get_user_flags(id)&ADMIN_LEVEL_A)) {
- console_print(id,"你沒有权限使用这项指令.")
- return PLUGIN_HANDLED
- }
- set_task(0.0,"alert")
- set_task(14.0,"ten")
- set_task(15.0,"nine")
- set_task(16.0,"eight")
- set_task(17.0,"seven")
- set_task(18.0,"six")
- set_task(19.0,"five")
- set_task(20.0,"four")
- set_task(21.0,"three")
- set_task(22.0,"two")
- set_task(23.0,"one")
- set_task(24.0,"zero")
- set_task(38.0,"restart_server")
- return PLUGIN_HANDLED
- }
- public alert() {
- client_print(0,print_chat,"***** 敬請注意!!!本服务器将于 39 秒后重起!!!*****")
- client_cmd(0,"spk ^"misc/chongqi.wav^"")
- }
- public ten() {
- client_print(0,print_chat,"..........本服务器重起倒数计时 10 秒..........")
- client_cmd(0,"spk ^"fvox/ten.wav^"")
- }
- public nine() {
- client_print(0,print_chat,"..........本服务器重起倒数计时 9 秒..........")
- client_cmd(0,"spk ^"fvox/nine.wav^"")
- }
- public eight() {
- client_print(0,print_chat,"..........本服务器重起倒数计时 8 秒..........")
- client_cmd(0,"spk ^"fvox/eight.wav^"")
- }
- public seven() {
- client_print(0,print_chat,"..........本服务器重起倒数计时 7 秒..........")
- client_cmd(0,"spk ^"fvox/seven.wav^"")
- }
- public six() {
- client_print(0,print_chat,"..........本服务器重起倒数计时 6 秒..........")
- client_cmd(0,"spk ^"fvox/six.wav^"")
- }
- public five() {
- client_print(0,print_chat,"..........本服务器重起倒数计时 5 秒..........")
- client_cmd(0,"spk ^"fvox/five.wav^"")
- }
- public four() {
- client_print(0,print_chat,"..........本服务器重起倒数计时 4 秒..........")
- client_cmd(0,"spk ^"fvox/four.wav^"")
- }
- public three() {
- client_print(0,print_chat,"..........本服务器重起倒数计时 3 秒..........")
- client_cmd(0,"spk ^"fvox/three.wav^"")
- }
- public two() {
- client_print(0,print_chat,"..........本服务器重起倒数计时 2 秒..........")
- client_cmd(0,"spk ^"fvox/two.wav^"")
- }
- public one() {
- client_print(0,print_chat,"..........本服务器重起倒数计时 1 秒..........")
- client_cmd(0,"spk ^"fvox/one.wav^"")
- }
- public zero() {
- client_print(0,print_chat,".......................请稍后,服务器重起中........................")
- client_cmd(0,"spk ^"misc/chongqi.wav^"")
- }
- public restart_server() {
- client_cmd(0,"retry",1.5) //服务器重起后,客户机自动连接服务器
- server_cmd("restart") //服务器重起命令
- //server_cmd("quit") //关闭服务器命令exit也可以。
- }
复制代码 问题1:所有声音文件按照插件内容放在相应目录,客户段进入服务器只下载chongqi.wav,其他1-10的声音文件均不下载,当然倒数的时候客户端也没有1-10的语音播报,请问是源码那里不正确还是其他地方有问题呢?
问题2:劳烦哪位热心大哥,发个HUD版的,不胜感激。
备注:服务器使用 心静如水 的1.8.2 客户端用timeleft thetime 不语音播报(服务器AMXX.CFG已设置语音播报为开启),也没时间显示,是不是跟这个有关系呢? |
|