搜索
查看: 1986|回复: 0

[AMXX 带源码] 请教黑夜模式插件 哪个控制黑暗程度

[复制链接]
发表于 2009-8-22 23:43:28 | 显示全部楼层 |阅读模式 来自 中国–湖北–武汉
下面是最后三分钟黑夜模式

请教高手哪段代码是调试黑暗的程度


  1. #include <amxmodx>
  2. #include <engine>
  3. #define WARN_TIME 10
  4. #define TASK_NIGHT 363636
  5. new count
  6. public updatelights()
  7. {
  8.         new msg[512]
  9.         format(msg, 511,"^x04【现在开始黑夜模式,请购买夜视仪!!】^x01", WARN_TIME)
  10.         client_color(0, msg)
  11.         client_cmd(0,"spk misc/cvt_night0")
  12.         set_task(1.0, "night", TASK_NIGHT,_,_, "a", WARN_TIME)
  13. }
  14. public night()
  15. {
  16.         count++
  17.         new word[6]
  18.         num_to_word(WARN_TIME - count, word, 5)
  19.         client_cmd(0, "spk vox/%s", word)
  20.         if(count == WARN_TIME)
  21.         {
  22.                 set_lights("a")
  23.                 count = 0
  24.         }
  25. }
  26. public client_color(id,msg[])
  27. {
  28.         new playerslist[32],playerscount//,i
  29.         get_players(playerslist,playerscount,"c")
  30.         while(replace(msg,127,"0x01","^x01")){}
  31.         while(replace(msg,127,"0x02","^x02")){}
  32.         while(replace(msg,127,"0x03","^x03")){}
  33.         while(replace(msg,127,"0x04","^x04")){}
  34.         if(id==0){
  35.                 message_begin(MSG_ALL, get_user_msgid("SayText"), {0,0,0},1)
  36.                 write_byte(1)
  37.                 write_string(msg)
  38.                 message_end()
  39.                
  40.         }
  41.         else{
  42.                 message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)
  43.                 write_byte(id)
  44.                 write_string(msg)
  45.                 message_end()
  46.         }
  47. }
  48. public round_restart()
  49. {
  50.         if(task_exists(TASK_NIGHT))
  51.         {
  52.                 remove_task(TASK_NIGHT)
  53.                 count = 0
  54.         }
  55.         set_lights("#OFF")
  56. }
  57. public plugin_precache()
  58. {
  59.         precache_sound( "misc/cvt_night0.wav")
  60. }
  61. public plugin_init()
  62. {
  63.         register_plugin("Daylight Changer","0.15x","[RED-Designs](Downtown1)")
  64.         register_event("TextMsg", "round_restart", "a", "2=#Game_Commencing", "2=#Game_will_restart_in")
  65.         set_task(190.0, "updatelights", 393939,_,_,"d")
  66. }

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

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