搜索
查看: 126|回复: 2

【cs1.6】 夜视仪亮度怎么修改

[复制链接]
发表于 2024-6-3 18:14:51 | 显示全部楼层 |阅读模式 来自 香港
我要修改一下 KZ的主插件 打开夜视仪亮度问题

找了好几个 kz的源码 没有找到合适的

我想要 打开夜视仪 所以地方都亮度都提高的

在网上找了一个版本 是 打开之后 鼠标冲着哪里 哪里才会生成光源
有没有大佬 求助!!!

夜视仪效果 就跟赛盟差不多就行 是全亮 而不是 鼠标在哪里 哪里生成光源

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
发表于 2024-6-6 00:41:15 | 显示全部楼层 来自 四川成都
  1. #include <amxmodx>
  2. #include <fakemeta>

  3. new const PLUGIN_VERSION[] = "1.0"

  4. new g_nightvision[33]

  5. new g_default_map_light[32]

  6. new g_fwLightStyle

  7. new g_msgScreenFade

  8. public plugin_precache()
  9. {
  10.         register_plugin("New NightVision", PLUGIN_VERSION, "Fai")
  11.        
  12.         g_fwLightStyle = register_forward(FM_LightStyle, "fw_LightStyle")
  13. }

  14. public plugin_init()
  15. {
  16.         unregister_forward(FM_LightStyle, g_fwLightStyle)
  17.        
  18.         g_msgScreenFade = get_user_msgid("ScreenFade")
  19.        
  20.         register_message(g_msgScreenFade, "message_screenfade")
  21.         register_message(get_user_msgid("NVGToggle"), "message_nvgtoggle")
  22.        
  23.         set_cvar_num("sv_skycolor_r", 0)
  24.         set_cvar_num("sv_skycolor_g", 0)
  25.         set_cvar_num("sv_skycolor_b", 0)
  26. }

  27. public fw_LightStyle(style, const val[])
  28. {
  29.         if (!style)
  30.                 copy(g_default_map_light, charsmax(g_default_map_light), val)
  31. }

  32. public message_screenfade(msg_id, msg_dest, msg_entity)
  33. {
  34.         if (!g_nightvision[msg_entity])
  35.                 return PLUGIN_CONTINUE;
  36.        
  37.         if (get_msg_arg_int(4) != 255 || get_msg_arg_int(5) != 255 || get_msg_arg_int(6) != 255 || get_msg_arg_int(7) < 200)
  38.                 return PLUGIN_CONTINUE;
  39.        
  40.         remove_task(msg_entity)
  41.         set_task(get_msg_arg_int(1) / 4096.0, "task_restore_screenfade", msg_entity)
  42.        
  43.         return PLUGIN_CONTINUE;
  44. }

  45. public message_nvgtoggle(msg_id, msg_dest, msg_entity)
  46. {
  47.         static flag
  48.         flag = get_msg_arg_int(1)
  49.        
  50.         message_begin(MSG_ONE_UNRELIABLE, SVC_LIGHTSTYLE, _, msg_entity)
  51.         write_byte(0)
  52.        
  53.         if (flag)
  54.                 write_string("#")
  55.         else
  56.                 write_string(g_default_map_light)
  57.        
  58.         message_end()
  59.        
  60.         if (!task_exists(msg_entity))
  61.         {
  62.                 message_begin(MSG_ONE, g_msgScreenFade, _, msg_entity)
  63.                 write_short((1<<12))
  64.                 write_short(0)
  65.                 write_short(0x0004)
  66.                
  67.                 if (flag)
  68.                 {
  69.                         write_byte(255)
  70.                         write_byte(128)
  71.                         write_byte(128)
  72.                         write_byte(73)
  73.                 }
  74.                 else
  75.                 {
  76.                         write_byte(0)
  77.                         write_byte(0)
  78.                         write_byte(0)
  79.                         write_byte(0)
  80.                 }
  81.                
  82.                 message_end()
  83.         }
  84.        
  85.         g_nightvision[msg_entity] = flag
  86.        
  87.         return PLUGIN_HANDLED;
  88. }

  89. public task_restore_screenfade(id)
  90. {
  91.         if (!g_nightvision[id])
  92.                 return;
  93.        
  94.         message_begin(MSG_ONE, g_msgScreenFade, _, id)
  95.         write_short((1<<12))
  96.         write_short(0)
  97.         write_short(0x0004)
  98.         write_byte(255)
  99.         write_byte(128)
  100.         write_byte(128)
  101.         write_byte(73)
  102.         message_end()
  103. }
复制代码


代码来源:https://forums.alliedmods.net/showthread.php?t=181953
回复

使用道具 举报

发表于 2024-6-9 20:27:27 | 显示全部楼层 来自 河南郑州
k1nader 发表于 2024-6-6 00:41
代码来源:https://forums.alliedmods.net/showthread.php?t=181953

强!   论坛好久都没人更新了
回复

使用道具 举报

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

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