LUA скрипт [NL] Svaston.lua fix

Juicy
Участник
Участник
Статус
Оффлайн
Регистрация
5 Май 2021
Сообщения
775
Реакции
167
https://yougame.biz/threads/358628/ - пишу скрипты за респект

скрина не будет.
Svaston.lua fix:
Expand Collapse Copy
local function DEG2RAD(x) return x * math.pi / 180 end
local function RAD2DEG(x) return x * 180 / math.pi end
 
local function hsv2rgb(h, s, v, a)
    local r, g, b
 
    local i = math.floor(h * 6);
    local f = h * 6 - i;
    local p = v * (1 - s);
    local q = v * (1 - f * s);
    local t = v * (1 - (1 - f) * s);
 
    i = i % 6
 
    if i == 0 then r, g, b = v, t, p
    elseif i == 1 then r, g, b = q, v, p
    elseif i == 2 then r, g, b = p, v, t
    elseif i == 3 then r, g, b = p, q, v
    elseif i == 4 then r, g, b = t, p, v
    elseif i == 5 then r, g, b = v, p, q
    end
 
    return r * 999, g * 999, b * 999, a * 999
end
 
local rainbow = 0.00
local rotationdegree = 0.000
 
local function draw_svaston(x, y, size)
    local frametime = globals.frametime
    local a = size / 60
    local gamma = math.atan(a / a)
    rainbow = rainbow + (frametime * 0.5)
    if rainbow > 1.0 then rainbow = 0.0 end
    if rotationdegree > 89 then rotationdegree = 0 end
 
    for i = 0, 4 do
        local p_0 = (a * math.sin(DEG2RAD(rotationdegree + (i * 90))))
        local p_1 = (a * math.cos(DEG2RAD(rotationdegree + (i * 90))))
        local p_2 =((a / math.cos(gamma)) * math.sin(DEG2RAD(rotationdegree + (i * 90) + RAD2DEG(gamma))))
        local p_3 =((a / math.cos(gamma)) * math.cos(DEG2RAD(rotationdegree + (i * 90) + RAD2DEG(gamma))))
 
        render.line(vector(x, y), vector(x + p_0, y - p_1), color(hsv2rgb(rainbow, 1, 1, 1)))
        render.line(vector(x + p_0, y - p_1), vector(x + p_2, y - p_3), color(hsv2rgb(rainbow, 1, 1, 1)))
    end
    rotationdegree = rotationdegree + (frametime * 150)
end

local before_load = cvar.cl_crosshairalpha:int()
local screen = render.screen_size()

events.render(function()
    local me = entity.get_local_player()
    if not me or not me:is_alive() then return end

    cvar.cl_crosshairalpha:int(0)
    draw_svaston(screen.x / 2, screen.y / 2, screen.y / 2)
end)

events.shutdown(function()
    cvar.cl_crosshairalpha:int(before_load)
end)
 
в чем была проблема то?
 
Назад
Сверху Снизу