LUA скрипт [nixware] Skeet scope with anim

life is cheap, death is free!
Эксперт
Статус
Оффлайн
Регистрация
9 Дек 2019
Сообщения
1,603
Реакции[?]
517
Поинты[?]
2K
Thx for visual nozoom / Спасибо за визуальное отсутствие зума:
Пожалуйста, авторизуйтесь для просмотра ссылки.
(noad)
Original skeet scope theme / Оригинальная тема откуда брал скит скоуп: https://yougame.biz/threads/232731

Код:
local m_bIsScoped = se.get_netvar("DT_CSPlayer", "m_bIsScoped")
local Scope = false
local offset = ui.add_slider_int("Offset", "offset_scope", 0, 500, 10)
local length = ui.add_slider_int("Length", "length_scope", 0, 1000, 60)
local anim_speed = ui.add_slider_int("Animation speed", "anim_speed_scope", 1, 30, 15)
local animoffset = ui.add_check_box("Animate offset", "animoffset_scope", false)
local col_1 = ui.add_color_edit("First color", "scope_color1", true, color_t.new(255, 255, 255, 255))
local col_2 = ui.add_color_edit("Second color", "scope_color2", true, color_t.new(255, 255, 255, 10))
local anim_num = 0
local lerp = function(a, b, t)
    return a + (b - a) * t
end
client.register_callback("frame_stage_notify", function(s)
    if s ~= 5 then return end
    local local_player = entitylist:get_local_player()
    local bIsScoped = local_player:get_prop_bool(se.get_netvar("DT_CSPlayer", "m_bIsScoped"))
    local_player:set_prop_int(m_bIsScoped, bIsScoped and 1 or 0)
    Scope = bIsScoped and true or false
    if local_player:get_prop_int(m_bIsScoped) then
        local_player:set_prop_int(m_bIsScoped, 0)
    end
end)
client.register_callback("paint", function()
    local local_player = entitylist:get_local_player()
    local screen = engine.get_screen_size()
    local start_x, start_y = screen.x /2, screen.y /2
    local offsett = offset:get_value()
    local lengthh = length:get_value() * anim_num
    local width = 1
    local col1 = col_1:get_value() col1.a = col1.a * anim_num
    local col2 = col_2:get_value() col2.a = col2.a * anim_num
    local animcond = Scope and local_player:is_alive()
    anim_num = lerp(anim_num, animcond and 1 or 0, anim_speed:get_value() * globalvars.get_frame_time())
    offsett = animoffset:get_value() and offsett * anim_num or offsett
    --left
    renderer.rect_filled_fade(vec2_t.new(start_x - offsett + 1, start_y), vec2_t.new(start_x - offsett - lengthh + 1, start_y + width), col1, col2, col2, col1)
    --right
    renderer.rect_filled_fade(vec2_t.new(start_x + offsett, start_y), vec2_t.new(start_x + offsett + lengthh, start_y + width), col1, col2, col2, col1)
    --down
    renderer.rect_filled_fade(vec2_t.new(start_x, start_y + offsett), vec2_t.new(start_x + width, start_y + offsett + lengthh), col1, col1, col2, col2)
    --up
    renderer.rect_filled_fade(vec2_t.new(start_x, start_y - offsett + 1), vec2_t.new(start_x + width, start_y - offsett - lengthh + 1), col1, col1, col2, col2)
end)
 
Последнее редактирование:
Легенда форума
Статус
Оффлайн
Регистрация
16 Сен 2018
Сообщения
4,004
Реакции[?]
1,947
Поинты[?]
7K
Так ведь там тема от меня была с этим скопом, только адекватным решением
 
Легенда форума
Статус
Оффлайн
Регистрация
16 Сен 2018
Сообщения
4,004
Реакции[?]
1,947
Поинты[?]
7K
life is cheap, death is free!
Эксперт
Статус
Оффлайн
Регистрация
9 Дек 2019
Сообщения
1,603
Реакции[?]
517
Поинты[?]
2K
микро апдейт
добавил чекбокс на анимацию оффсета или нет
 
Начинающий
Статус
Оффлайн
Регистрация
16 Июн 2021
Сообщения
33
Реакции[?]
7
Поинты[?]
0
Можешь снять компил через декомпилятор от того же рейва

да и это далеко не лучше лол, костыль
это не костыль, я считаю. намного лучше чем через draw_vgui

кстати дашь линк на декомпил?
 
Сверху Снизу