|
发表于 2008-4-15 12:45:51
|
显示全部楼层
来自 中国–北京–北京–海淀区
回复: 求点通高手修改天黑模式的插件!(jim_yang 大哥进来下)
- #include <amxmodx>
- #include <engine>
- #define WARN_TIME 10
- #define TASK_NIGHT 363636
- public updatelights()
- {
- new msg[512]
- format(msg, 511,"^x04【注意危险应变课程%d秒后开始】^x01", WARN_TIME)
- client_color(0, msg)
- client_cmd(0,"spk misc/cvt_night0")
- set_task(1.0, "night", _,_,_, "a", WARN_TIME)
- }
- public night()
- {
- static count
- count++
- new word[6]
- num_to_word(WARN_TIME - count, word, 5)
- client_cmd(0, "spk vox/%s", word)
- if(count == WARN_TIME)
- set_lights("b")
- }
- public client_color(id,msg[])
- {
- new playerslist[32],playerscount//,i
- get_players(playerslist,playerscount,"c")
- while(replace(msg,127,"0x01","^x01")){}
- while(replace(msg,127,"0x02","^x02")){}
- while(replace(msg,127,"0x03","^x03")){}
- while(replace(msg,127,"0x04","^x04")){}
- if(id==0){
- message_begin(MSG_ALL, get_user_msgid("SayText"), {0,0,0},1)
- write_byte(1)
- write_string(msg)
- message_end()
-
- }
- else{
- message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)
- write_byte(id)
- write_string(msg)
- message_end()
- }
- }
- public round_restart()
- {
- if(task_exists(TASK_NIGHT))
- remove_task(TASK_NIGHT)
- set_lights("#OFF")
- }
- public plugin_precache()
- {
- precache_sound( "misc/cvt_night0.wav")
- }
- public plugin_init()
- {
- register_plugin("Daylight Changer","0.15x","[RED-Designs](Downtown1)")
- register_event("TextMsg", "round_restart", "a", "2=#Game_Commencing", "2=#Game_will_restart_in")
- set_task(180.0, "updatelights", 393939,_,_,"d")
- }
复制代码 修改WARN_TIME 可以自定义警告多少秒,最好不要超过十,因为word[]数组能放的最大单词就是五个字母,多了有些语音就听不到了。
你试试吧 |
|