[TUT] Ночное виденье из CSO-NST
[TUT] Ночное виденье из CSO-NST
1.Создаем new bool:g_Nightvision[33] = false
2.Добавляем квары cvar_nvg_alpha, cvar_humnvg_alpha, cvar_nemnvg_alpha
3.Ищем clcmd_nightvision(id) и заменяем на
Показать / Скрыть текст
public clcmd_nightvision(id)
{
if (g_nvision[id])
{
if(g_Nightvision[id])
{
remove_task(id+TASK_NVISION)
g_Nightvision[id] = false
off(id)
}
else
{
g_Nightvision[id] = true
set_task(0.1, \”set_user_nvision\”, id+TASK_NVISION, _, _, \”b\”)
}
}
return PLUGIN_HANDLED;
}
4.Ищем set_user_nvision(taskid) и заменяем на
Показать / Скрыть текст
public set_user_nvision(taskid)
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid(\”ScreenFade\”), _, ID_NVISION)
write_short(0) // duration
write_short(0) // hold time
write_short(0x0004) // fade type
// Nemesis / Madness / Spectator in nemesis round
if (g_nemesis[ID_NVISION] || (g_zombie[ID_NVISION] && g_nodamage[ID_NVISION]) || (!g_isalive[ID_NVISION] && g_nemround))
{
write_byte(get_pcvar_num(cvar_nemnvgcolor[0])) // r
write_byte(get_pcvar_num(cvar_nemnvgcolor[1])) // g
write_byte(get_pcvar_num(cvar_nemnvgcolor[2])) // b
write_byte(get_pcvar_num(cvar_nemnvg_alpha))
}
// Human / Spectator in normal round
else if (!g_zombie[ID_NVISION] || !g_isalive[ID_NVISION])
{
write_byte(get_pcvar_num(cvar_humnvgcolor[0])) // r
write_byte(get_pcvar_num(cvar_humnvgcolor[1])) // g
write_byte(get_pcvar_num(cvar_humnvgcolor[2])) // b
write_byte(get_pcvar_num(cvar_humnvg_alpha))
}
// Zombie
else
{
write_byte(get_pcvar_num(cvar_nvgcolor[0])) // r
write_byte(get_pcvar_num(cvar_nvgcolor[1])) // g
write_byte(get_pcvar_num(cvar_nvgcolor[2])) // b
write_byte(get_pcvar_num(cvar_nvg_alpha))
}
message_end()
set_player_light(ID_NVISION, \”z\”)
}
5.Добавляем код
Показать / Скрыть текст
public off(id)
{
message_begin(MSG_ONE, get_user_msgid(\”ScreenFade\”), {0,0,0}, id)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
if (g_nemesis[id] || (g_zombie[id] && g_nodamage[id]) || (!g_isalive[id] && g_nemround))
{
write_byte(get_pcvar_num(cvar_nemnvgcolor[0])) // r
write_byte(get_pcvar_num(cvar_nemnvgcolor[1])) // g
write_byte(get_pcvar_num(cvar_nemnvgcolor[2])) // b
write_byte(get_pcvar_num(cvar_nemnvg_alpha))
}
// Human / Spectator in normal round
else if (!g_zombie[id] || !g_isalive[id])
{
write_byte(get_pcvar_num(cvar_humnvgcolor[0])) // r
write_byte(get_pcvar_num(cvar_humnvgcolor[1])) // g
write_byte(get_pcvar_num(cvar_humnvgcolor[2])) // b
write_byte(get_pcvar_num(cvar_humnvg_alpha))
}
// Zombie
else
{
write_byte(get_pcvar_num(cvar_nvgcolor[0])) // r
write_byte(get_pcvar_num(cvar_nvgcolor[1])) // g
write_byte(get_pcvar_num(cvar_nvgcolor[2])) // b
write_byte(get_pcvar_num(cvar_nvg_alpha))
}
message_end()
set_player_light(id, \”d\”)
}
6.Добавляем сток
Показать / Скрыть текст
stock set_player_light(id, const LightStyle[])
{
message_begin(MSG_ONE, SVC_LIGHTSTYLE, .player = id)
write_byte(0)
write_string(LightStyle)
message_end()
}
Настройка CSO:
cvar_nvgcolor[0] = 253
cvar_nvgcolor[1] = 110
cvar_nvgcolor[2] = 110
cvar_nvg_alpha = 70
set_player_light(id, \”d\”) – заместо d пишите свое освещение
Плагин под ZP5.0
Понравилась статья? Поделиться с друзьями: