搜索
查看: 1561|回复: 1

我修改了天黑插件 但是为什么天色总是不是均变

[复制链接]
发表于 2008-6-2 21:08:30 | 显示全部楼层 |阅读模式 来自 中国–广东–广州–天河区
/* Daylight Changerby Downtown1
* Updated and converted to AMXX 0.15(& up)
*                        by [RED-Designs]
*/
#include <amxmodx>
#include <engine>
public updatelights()
{
new szHours[2]
new iHours
new szLights[10] = "c"
get_time("%S", szHours, 2)
iHours = str_to_num(szHours)
switch(iHours)
{
  case 1:szLights = "a"
  case 2:szLights = "b"
  case 3:szLights = "c"
  case 4:szLights = "d"
  case 5:szLights = "e"
  case 6:szLights = "f"
  case 7:szLights = "g"
  case 8:szLights = "h"
  case 9:szLights = "i"
  case 10:szLights = "j"
  case 11:szLights = "k"
  case 12:szLights = "l"
  case 13:szLights = "m"
  case 14:szLights = "n"
  case 15:szLights = "o"
  case 16:szLights = "p"
  case 17:szLights = "q"
  case 18:szLights = "r"
  case 19:szLights = "s"
  case 20:szLights = "t"
  case 21:szLights = "u"
  case 22:szLights = "v"
  case 23:szLights = "w"
  case 24:szLights = "x"
              case 25:szLights = "y"
              case 26:szLights = "z"
case 27:szLights = "#OFF"
case 28:szLights = "#OFF"
case 29:szLights = "#OFF"
case 30:szLights = "#OFF"
case 31:szLights = "#OFF"
case 32:szLights = "#OFF"
case 33:szLights = "z"
case 34:szLights = "y"
case 35:szLights = "x"
case 36:szLights = "w"
case 37:szLights = "v"
case 38:szLights = "u"
case 39:szLights = "t"
case 40:szLights = "s"
case 41:szLights = "r"
case 42:szLights = "q"
case 43:szLights = "p"
case 44:szLights = "o"
case 45:szLights = "n"
case 46:szLights = "m"
case 47:szLights = "l"
case 48:szLights = "k"
case 49:szLights = "j"
case 50:szLights = "i"
case 51:szLights = "h"
case 52:szLights = "g"
case 53:szLights = "f"
case 54:szLights = "e"
case 55:szLights = "d"
case 56:szLights = "c"
case 57:szLights = "b"
  default:szLights = "c"
}
set_lights(szLights)
return PLUGIN_CONTINUE
}
public plugin_init()
{
register_plugin("Daylight Changer","0.15x","[RED-Designs](Downtown1)")
        register_cvar("sv_daylight", "1" )
if (get_cvar_float("sv_daylight")==1){
set_task(0.1, "updatelights", 0, "", 0, "b")
}
return PLUGIN_CONTINUE
}






本以为这样是均变 谁知道 有一个地方暗了一下又突然光起来 然后又暗
有一个地方是 光了一下又暗了一点 然后又光了

其他还是挺平均的

求高手指教
发表于 2008-6-2 22:38:03 | 显示全部楼层 来自 中国–广东–深圳

回复: 我修改了天黑插件 但是为什么天色总是不是均变

Post by zdzx
/* Daylight Changerby Downtown1
* Updated and converted to AMXX 0.15(& up)
* by [RED-Designs]
*/
#include <amxmodx>
#include <engine>
public updatelights()
{
new szHours[2]
new iHours
new szLights[10] = "c"
get_time("%S", szHours, 2)
...

get_time("%S", szHours, 2)是每秒变化一次。
改成小时get_time("%H", szHours, 2)

去掉多余24的case
回复

使用道具 举报

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

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