Баг в анимации

  • 10
  • 0
Lua:
local function main_anim(c, a, b, s)
    if c then
        return a + (b - a) * GlobalVars.frametime * s
    else
        return a - (b + a) * GlobalVars.frametime * s
    end
end

local size = {
    smoke = -30
}

Cheat.RegisterCallback('draw', function()
    if not EngineClient.GetLocalPlayer() then return end

    local CSmokeGrenadeProjectile = EntityList.GetEntitiesByName('CSmokeGrenadeProjectile')

    if not CSmokeGrenadeProjectile then return end

    for i = 1, #CSmokeGrenadeProjectile do
        local smoke = CSmokeGrenadeProjectile[i]

        if not smoke then return end

        size.smoke = main_anim(smoke:GetProp('m_bDidSmokeEffect'), size.smoke, 149, 6)

        if not smoke:GetProp('m_bDidSmokeEffect') then return end

        Render.Circle3D(smoke:GetRenderOrigin(), 69, math.max(size.smoke, 0), Color.new(0.24, 0.57, 0.98, 0.7))
    end
end)
[/i]
 
  • spinninonthestage
  • Пистолет, букет и цветы только чётные
  • 850
  • 2
  • 304
Стоит воспользоватся этим
И изучить это:

бебра:
local Menu_Smoke_Radius = Menu.SwitchColor("Alternative Grenade Radius", "Smoke Radius", false, Color.new(0.24, 0.57, 0.98, 0.7))
local Menu_Molotov_Radius = Menu.SwitchColor("Alternative Grenade Radius", "Molotov Radius", false, Color.new(1.0, 0.25, 0.25, 0.74))
local Thickness = Menu.SliderInt("Alternative Grenade Radius", "Thickness", 8, 1, 100)
local Quality = Menu.SliderInt("Alternative Grenade Radius", "Quality", 64, 16, 100)
local function Distance_2D(Position_A, Position_B)
    return math.sqrt((Position_B.x - Position_A.x) ^ 2 + (Position_B.y - Position_A.y) ^ 2)
end
local function Lerp_Position(Position_A, Position_B, Percentage)
    return Vector.new((Position_B.x - Position_A.x) * Percentage + Position_A.x, (Position_B.y - Position_A.y) * Percentage + Position_A.y, (Position_B.z - Position_A.z) * Percentage + Position_A.z)
end
Cheat.RegisterCallback("draw", function()
    if Menu_Smoke_Radius:GetBool() then
        local Smokes = EntityList.GetEntitiesByName("CSmokeGrenadeProjectile")
        for t = 1, #Smokes do
            local Smoke = Smokes[t]
            if Smoke:GetProp("m_bDidSmokeEffect") == true then
                for p = 1, Thickness:GetInt() do
                    Render.Circle3D(Smoke:GetRenderOrigin(), Quality:GetInt(), 125 - 0.05 * p, Menu_Smoke_Radius:GetColor())
                end
            end
        end
    end
    if Menu_Molotov_Radius:GetBool() then
        local Molotovs = EntityList.GetEntitiesByName("CInferno")
        for i = 1, #Molotovs do
            local Molotov = Molotovs[i]
            local Origin = Molotov:GetRenderOrigin()
            local Cell_Radius = 40
            local Molotov_Radius = 0
            local Cells = {}
            local Maximum_Distance = 0
            local Cell_Max_A, Cell_Max_B
            for i = 1, 64 do
                if Molotov:GetProp("m_bFireIsBurning")[i] == true then
                    table.insert(Cells, Vector.new(Molotov:GetProp("m_fireXDelta")[i], Molotov:GetProp("m_fireYDelta")[i], Molotov:GetProp("m_fireZDelta")[i]))
                end
            end
            for v = 1, #Cells do
                for k = 1, #Cells do
                    local Distance = Distance_2D(Cells[v], Cells[k])
                    if Distance > Maximum_Distance then
                        Maximum_Distance = Distance
                        Cell_Max_A = Cells[v]
                        Cell_Max_B = Cells[k]
                    end
                end
            end
            if Cell_Max_A ~= nil and Cell_Max_B ~= nil then
                local Center_Delta = Lerp_Position(Cell_Max_A, Cell_Max_B, 0.5)
                local Center = Origin + Center_Delta
                for g = 1, Thickness:GetInt() do
                    Render.Circle3D(Center, Quality:GetInt(), Maximum_Distance / 2 + Cell_Radius - 0.05 * g, Menu_Molotov_Radius:GetColor())
                end
            end
        end
    end
end)
[/i][/i][/i][/i][/i]
 
Последнее редактирование:
  • 10
  • 0
Стоит воспользоватся этим
И изучить это:

бебра:
local Menu_Smoke_Radius = Menu.SwitchColor("Alternative Grenade Radius", "Smoke Radius", false, Color.new(0.24, 0.57, 0.98, 0.7))
local Menu_Molotov_Radius = Menu.SwitchColor("Alternative Grenade Radius", "Molotov Radius", false, Color.new(1.0, 0.25, 0.25, 0.74))
local Thickness = Menu.SliderInt("Alternative Grenade Radius", "Thickness", 8, 1, 100)
local Quality = Menu.SliderInt("Alternative Grenade Radius", "Quality", 64, 16, 100)
local function Distance_2D(Position_A, Position_B)
    return math.sqrt((Position_B.x - Position_A.x) ^ 2 + (Position_B.y - Position_A.y) ^ 2)
end
local function Lerp_Position(Position_A, Position_B, Percentage)
    return Vector.new((Position_B.x - Position_A.x) * Percentage + Position_A.x, (Position_B.y - Position_A.y) * Percentage + Position_A.y, (Position_B.z - Position_A.z) * Percentage + Position_A.z)
end
Cheat.RegisterCallback("draw", function()
    if Menu_Smoke_Radius:GetBool() then
        local Smokes = EntityList.GetEntitiesByName("CSmokeGrenadeProjectile")
        for t = 1, #Smokes do
            local Smoke = Smokes[t]
            if Smoke:GetProp("m_bDidSmokeEffect") == true then
                for p = 1, Thickness:GetInt() do
                    Render.Circle3D(Smoke:GetRenderOrigin(), Quality:GetInt(), 125 - 0.05 * p, Menu_Smoke_Radius:GetColor())
                end
            end
        end
    end
    if Menu_Molotov_Radius:GetBool() then
        local Molotovs = EntityList.GetEntitiesByName("CInferno")
        for i = 1, #Molotovs do
            local Molotov = Molotovs[i]
            local Origin = Molotov:GetRenderOrigin()
            local Cell_Radius = 40
            local Molotov_Radius = 0
            local Cells = {}
            local Maximum_Distance = 0
            local Cell_Max_A, Cell_Max_B
            for i = 1, 64 do
                if Molotov:GetProp("m_bFireIsBurning")[i] == true then
                    table.insert(Cells, Vector.new(Molotov:GetProp("m_fireXDelta")[i], Molotov:GetProp("m_fireYDelta")[i], Molotov:GetProp("m_fireZDelta")[i]))
                end
            end
            for v = 1, #Cells do
                for k = 1, #Cells do
                    local Distance = Distance_2D(Cells[v], Cells[k])
                    if Distance > Maximum_Distance then
                        Maximum_Distance = Distance
                        Cell_Max_A = Cells[v]
                        Cell_Max_B = Cells[k]
                    end
                end
            end
            if Cell_Max_A ~= nil and Cell_Max_B ~= nil then
                local Center_Delta = Lerp_Position(Cell_Max_A, Cell_Max_B, 0.5)
                local Center = Origin + Center_Delta
                for g = 1, Thickness:GetInt() do
                    Render.Circle3D(Center, Quality:GetInt(), Maximum_Distance / 2 + Cell_Radius - 0.05 * g, Menu_Molotov_Radius:GetColor())
                end
            end
        end
    end
end)
[/i][/i][/i][/i][/i]


Я не просил кидать мне код, и луа апи. Я лишь хочу узнать что я делаю не так.
 
Сверху Снизу