Как вырезать gs indicators из луа?

  • 7
  • 1
Контакты для связи отсутствуют.
1660201622869.png
 

Вложения

  • smert.lua.lua
    279.8 KB · Просмотры: 22
  • 813
  • 159
  • 163
Работает всё, кроме Dormant Aimbot индикатора
Lua:
local ui = {
    enable = Menu.Switch("-> Visuals", "All indicators", "Skeet Side indicators", false),
    mods = Menu.MultiCombo("-> Visuals", "All indicators", "Indicator elements", { "AA With Circle", "Shot/Miss Percent", "FL Text indicator", "Body Aim", "Exploit", "Damage", "Fake Ping", "Lag Compensation", "Fake Duck", "Bomb Info", "Double Tap"}, 0),
    hmstyle = Menu.Combo("-> Visuals", "All indicators","Hit/Miss Style",{"Style 1", "Style 2"},0),
    dmgtype = Menu.Combo("-> Visuals", "All indicators", "Damage type", {"Damage: ", "DMG", "Damage value"}, 0),
}
local easings = {
    lerp = function(start, vend, time)
        return start + (vend - start) * time
    end,
    
    clamp = function(val, min, max)
        if val > max then return max end
        if min > val then return min end
        return val
    end
}
function C_BaseEntity:GetVelocity()
    local first_velocity = self:GetProp("m_vecVelocity[0]")
    local second_velocity = self:GetProp("m_vecVelocity[1]")

    local speed = math.floor(math.sqrt(first_velocity * first_velocity + second_velocity * second_velocity))
    return speed
end
function C_BaseEntity:GetState()
    local flags = self:GetProp("m_fFlags")
    local velocity = self:GetVelocity()

    if bit.band(flags, 1) == 1 then
        if Menu.FindVar("Aimbot", "Anti Aim", "Misc", "Fake Duck"):GetBool() then
            return "FAKEDUCKING"
        else
            if bit.band(flags, 4) == 4 then
                if self:GetProp("m_iTeamNum") == 2 then
                    return "CROUCHING T"
                elseif self:GetProp("m_iTeamNum") == 3 then
                    return "CROUCHING CT"
                end
            else
                if Menu.FindVar("Aimbot", "Anti Aim", "Misc", "Slow Walk"):GetBool() then
                    return "SLOWWALKING"
                else
                    if velocity <= 3 then
                        return "STANDING"
                    else
                        return "MOVING"
                    end
                end
            end
        end
    elseif bit.band(flags, 1) == 0 then
        return "IN AIR"
    end
end
local utils = {
    fonts_library = {
        ["Smallest Pixel-7"] = {
            ["9"] = {
                [""] = {
                    Render.InitFont("Smallest Pixel-7", 9)
                }
            },
          
            ["10"] = {
                [""] = {
                    Render.InitFont("Smallest Pixel-7", 10)
                }
            }
        },
    
        ["Tahoma"] = {
            ["10"] = {
                [""] = {
                    Render.InitFont("Tahoma", 10)
                }
            }
        },
    
        ["Verdana"] = {
            ["10"] = {
                [""] = {
                    Render.InitFont("Verdana", 10)
                },
    
                ["b"] = {
                    Render.InitFont("Verdana", 10, {"b"})
                }
            },
    
            ["11"] = {
                ["r"] = {
                    Render.InitFont("Verdana", 11, {"r"})
                }
            },
    
            ["12"] = {
                [""] = {
                    Render.InitFont("Verdana", 12)
                }
            },
    
            ["21"] = {
                ["b"] = {
                    Render.InitFont("Verdana", 21, {"b"})
                }
            }
        },
    
        ["Calibri"] = {
            ["30"] = {
                ["b"] = {
                    Render.InitFont("Calibri", 30, {"b"})
                }
            }
        },
    
        ["Lucida Console"] = {
            ["10"] = {
                ["r"] = {
                    Render.InitFont("Lucida Console", 10, {"r"})
                }
            }
        }
    },
    get_desync = function(comma_index)
        local real_rotation = AntiAim.GetCurrentRealRotation()
        local fake_rotation = AntiAim.GetFakeRotation()
        local max_delta = AntiAim.GetMaxDesyncDelta()
        local delta = math.min(math.abs(real_rotation - fake_rotation), max_delta)

        return tonumber(string.format("%." .. comma_index .. "f", delta))
    end,

    draw_shadow = function(type, text, x, y, color, font_size, font, centered, shadow_color)
        local x_pos = type == 0 and 1 or type == 1 and 1 or type == 2 and 0 or 1
        local y_pos = type == 0 and 1 or type == 1 and 0 or type == 2 and 1 or 1

        Render.Text(text, Vector2.new(x + x_pos, y + y_pos), shadow_color, font_size, font, false, centered)
        Render.Text(text, Vector2.new(x + 0, y + 0), color, font_size, font, false, centered)
    end,

    get_font = function(self, font_name, font_size, flags)
        local library_names = self.fonts_library[font_name]
        local library_fonts = library_names[font_size]
        local library_flags = library_fonts[not flags and "" or flags][1]

        return library_flags
    end,
    skeet_modules = {
        vars = {
            fakelags = {
                fakelag_1 = 0,
                fakelag_2 = 0,
                fakelag_3 = 0,
                fakelag_4 = 0,
                fakelag_5 = 0,
                old_choke = 0
            },

            lag_compensation = {
                is_lc = false,
                timer = GlobalVars.curtime
            },

            fake = {
                smooth_fill = 0
            },

            shot_stats = {
                hits = 0,
                misses = 0,
                all_shots = 0,

                count_shots = function(self, shot)
                    if ui.enable:Get() then
                        if bit.band(ui.mods:Get(), bit.lshift(1, 4)) ~= 0 then
                            local localplayer = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
                            if not localplayer then return end
                          
                            local my_index = EntityList.GetClientEntity(EngineClient.GetLocalPlayer()):GetPlayer()
                            if not my_index then return end
      
                            if EngineClient.IsConnected() and my_index:IsAlive() then
                                if bit.band(ui.mods:Get(), bit.lshift(1, 1)) ~= 0 then
                                    if shot.reason == 0 then
                                        self.hits = self.hits + 1
                                    else
                                        self.misses = self.misses + 1
                                    end

                                    self.all_shots = self.all_shots + 1
                                end
                            end
                        end
                    end
                end,
            },

            bomb_info = {
                bombsite = -1,
                is_defusing = false,
                is_planting = false,
                plant_time = 0,

                on_begin_plant = function(self, e)
                    if e:GetName() ~= "bomb_beginplant" then return end
 
                    self.bombsite = e:GetInt("site")
                    self.is_planting = true
                    self.plant_time = GlobalVars.curtime
                end,

                on_bomb_plant = function(self, e)
                    if e:GetName() ~= "bomb_planted" then return end

                    self.bombsite = -1
                    self.is_planting = false
                end,

                on_abort_plant = function(self, e)
                    if e:GetName() ~= "bomb_abortplant" then return end
 
                    self.bombsite = -1
                    self.is_planting = false
                end,

                on_defusing = function(self, e)
                    if e:GetName() ~= "bomb_begindefuse" then return end

                    self.is_defusing = true
                end,

                on_abort_defusing = function(self, e)
                    if e:GetName() ~= "bomb_abortdefuse" then return end
                  
                    self.is_defusing = false
                end,

                on_round_prestart = function(self, e)
                    if e:GetName() ~= "round_prestart" then return end
 
                    self.bombsite = -1
                    self.is_defusing = false
                    self.is_planting = false
                    self.plant_time = 0
                end,

                on_self_connected = function(self, e)
                    if e:GetName() ~= "player_connect_full" then return end

                    self.plant_time = 0
                    local c4 = EntityList.GetEntitiesByClassID(129)[1]

                    if not c4 then
                        self.bombsite = -1
                        self.is_planting = false
                    else
                        self.is_planting = true
                        self.bombsite = c4:GetProp("m_nBombSite")
                    end
                end,

                load_bomb_modules = function(self, e)
                    self:on_begin_plant(e)
                    self:on_bomb_plant(e)
                    self:on_abort_plant(e)
                    self:on_round_prestart(e)
                    self:on_defusing(e)
                    self:on_abort_defusing(e)
                    self:on_self_connected(e)
                end
            }
        },

        directories = {
            isBaim = Menu.FindVar("Aimbot", "Ragebot", "Misc", "Body Aim")
        }
    },
}

local screen_size = EngineClient.GetScreenSize()
side_skeet_indicators = function(self)
    if ui.enable:Get() then
        if bit.band(ui.mods:Get(), bit.lshift(1, 4)) ~= 0 then
            local localplayer = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
            if not localplayer then return end
          
            local my_index = EntityList.GetClientEntity(EngineClient.GetLocalPlayer()):GetPlayer()
            if not my_index then return end

            if EngineClient.IsConnected() and my_index:IsAlive() then
                local indicator_list = {}
                local font = utils:get_font("Calibri", "30", "b")

                local add_x, add_y = 2, 50
                local x, y = screen_size.x / 100 - 3, screen_size.y / 1.50 - 5

                local render_indicator = function(text, color, add_y)
                    local text_size = Render.CalcTextSize(text, 22, font)
                    local back_alpha = 65
                  
                    Render.GradientBoxFilled(
                        Vector2.new(13, y + add_y),
                        Vector2.new(13 + text_size.x / 2, y + add_y + 28),
                        Color.RGBA(0, 0, 0, 0), Color.RGBA(0, 0, 0, back_alpha),
                        Color.RGBA(0, 0, 0, 0), Color.RGBA(0, 0, 0, back_alpha)
                    )

                    Render.GradientBoxFilled(
                        Vector2.new(13 + text_size.x / 2, y + add_y),
                        Vector2.new(13 + text_size.x, y + add_y + 28),
                        Color.RGBA(0, 0, 0, back_alpha), Color.RGBA(0, 0, 0, 0),
                        Color.RGBA(0, 0, 0, back_alpha), Color.RGBA(0, 0, 0, 0)
                    )

                    utils.draw_shadow(
                        2,
                        text,
                        x + add_x + 2, y + add_y + 4,
                        color,
                        23, font,
                        false, Color.RGBA(0, 0, 0, 170)
                    )
                end

                local render_circle = function(text, x_position, y_position, add_y, size, color, value)   
                    local text_size = Render.CalcTextSize(text, 22, font)
                  
                    Render.Circle(
                        Vector2.new(x + add_x + text_size.x + x_position + 3, y + add_y + text_size.y / 2 + y_position + 3),
                        size + 1, 60, Color.RGBA(0, 0, 0, 255), 3
                    )
                  
                    Render.Circle(
                        Vector2.new(x + add_x + text_size.x + x_position + 3, y + add_y + text_size.y / 2 + y_position + 3),
                        size, 60,
                        color,
                        4, 0, value
                    )
                end

                local get_text_fakelag = function()
                    local self_chocking = ClientState.m_choked_commands
                    if self_chocking < utils.skeet_modules.vars.fakelags.old_choke then
                        utils.skeet_modules.vars.fakelags.fakelag_1 = utils.skeet_modules.vars.fakelags.fakelag_2
                        utils.skeet_modules.vars.fakelags.fakelag_2 = utils.skeet_modules.vars.fakelags.fakelag_3
                        utils.skeet_modules.vars.fakelags.fakelag_3 = utils.skeet_modules.vars.fakelags.fakelag_4
                        utils.skeet_modules.vars.fakelags.fakelag_4 = utils.skeet_modules.vars.fakelags.fakelag_5
                        utils.skeet_modules.vars.fakelags.fakelag_5 = utils.skeet_modules.vars.fakelags.old_choke
                    end

                    utils.skeet_modules.vars.fakelags.old_choke = self_chocking
                    return ("%i-%i-%i-%i-%i"):format(
                        utils.skeet_modules.vars.fakelags.fakelag_1,
                        utils.skeet_modules.vars.fakelags.fakelag_2,
                        utils.skeet_modules.vars.fakelags.fakelag_3,
                        utils.skeet_modules.vars.fakelags.fakelag_4,
                        utils.skeet_modules.vars.fakelags.fakelag_5
                    )
                end

                local is_enabled = function(value)
                    return bit.band(ui.mods:Get(), bit.lshift(1, value)) ~= 0
                end

                utils.skeet_modules.vars.fake.smooth_fill = easings.lerp(
                    utils.skeet_modules.vars.fake.smooth_fill,
                    utils.get_desync(0),
                    GlobalVars.frametime * 5
                )

                local fake_color = Color.new(
                    (170 + (154 - 186) * utils.skeet_modules.vars.fake.smooth_fill / 60) / 255,
                    (0 + (255 - 0) * utils.skeet_modules.vars.fake.smooth_fill / 60) / 255,
                    (16 + (0 - 16) * utils.skeet_modules.vars.fake.smooth_fill / 60) / 255,
                    1
                )

                table.insert(indicator_list, {
                    type = "circle",

                    fl_text = "FAKE",
                    fl_color = fake_color,

                    x_pos = is_enabled(0) and 15 or "",
                    y_pos = 0,
                    size = 7,
                    color = fake_color,
                    value = utils.skeet_modules.vars.fake.smooth_fill * 6.4
                })

                if is_enabled(1) then
                    local hits = utils.skeet_modules.vars.shot_stats.hits
                    local misses = utils.skeet_modules.vars.shot_stats.misses
                    local all_shots = utils.skeet_modules.vars.shot_stats.all_shots

                    local selected_style = ui.hmstyle:Get()
                    if selected_style == 0 then
                        if all_shots > 0 then
                            local result_stats = ("%.1f"):format((hits / all_shots) * 100)
                            local result_text = ("%s/%s (%s)"):format(hits, all_shots, result_stats)

                            table.insert(indicator_list, {
                                type = "text",
                                text = result_text,
                                color = Color.RGBA(255, 255, 255, 255)
                            })
                        end
                    else
                        local hard_math = math.floor((hits / all_shots) * 100)
                        if hard_math ~= hard_math then hard_math = 100 end

                        local result_stats = ("%s%%"):format(hard_math)
                        local result_text = ("%s/%s"):format(misses, result_stats)

                        table.insert(indicator_list, {
                            type = "text",
                            text = result_text,
                            color = Color.RGBA(255, 255, 255, 255)
                        })
                    end
                end

                table.insert(indicator_list, {
                    type = "text",
                    text = is_enabled(2) and get_text_fakelag() or "",
                    color = Color.RGBA(255, 255, 255, 255)
                })

                table.insert(indicator_list, {
                    type = "text",
                    text = (is_enabled(3) and utils.skeet_modules.directories.isBaim:GetInt() == 2) and "BODY" or "",
                    color = Color.RGBA(255, 255, 255, 255)
                })

                local isDT = Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):GetBool()
                local binds = Cheat.GetBinds()
                local isDMG, curDMG, isPing = false, 0, false

                for i = 1, #binds do
                    local bind = binds[i]
                    if bind:IsActive() then
                        if bind:GetName() == "Minimum Damage" then
                            isDMG = true
                            curDMG = bind:GetValue()
                        end

                        if bind:GetName() == "Fake Ping" then
                            isPing = true
                        end
                    end
                end

                local current_state = my_index:GetState()
                if not current_state then return end

                table.insert(indicator_list, {
                    type = "text",
                    text = is_enabled(4) and "EX" or "",
                    color = (isDT and current_state == "IN AIR") and Color.RGBA(132, 195, 16, 255) or Color.RGBA(208, 208, 20, 255)
                })

                local damage_type = ui.dmgtype:Get()
                table.insert(indicator_list, {
                    type = "text",
                    text = (is_enabled(5) and isDMG) and (
                        damage_type == 0 and ("Damage: %s"):format(curDMG) or damage_type == 1 and ("DMG: %s"):format(curDMG)
                        or damage_type == 2 and tostring(curDMG) or ""
                    ) or "",
                    color = (
                        damage_type == 0 and Color.RGBA(255, 255, 255, 255) or damage_type == 1 and Color.RGBA(255, 255, 255, 150) or Color.RGBA(255, 255, 255, 255)
                    )
                })

                -- local isDA = menu_database.handler.elements["Enable dormant aimbot"]
                -- table.insert(indicator_list, {
                --     type = "text",
                --     text = (is_enabled(6) and isDA) and "DA" or "",
                --     color = Color.RGBA(132, 195, 16, 255)
                -- })

                local get_ping_color = function()
                    local ping = EntityList.GetPlayerResource():GetProp("DT_CSPlayerResource", "m_iPing")[2]
                    local color = Color.RGBA(
                        math.floor(255 - ((ping / 189 * 60) * 2.29824561404)),
                        math.floor((ping / 189 * 60) * 2.42105263158),
                        math.floor((ping / 189 * 60) * 0.22807017543),
                        255
                    )

                    return color
                end

                table.insert(indicator_list, {
                    type = "text",
                    text = (is_enabled(7) and isPing) and "PING" or "",
                    color = get_ping_color()
                })

                if my_index:GetState() == "IN AIR" then
                    utils.skeet_modules.vars.lag_compensation.is_lc = true
                    utils.skeet_modules.vars.lag_compensation.timer = GlobalVars.curtime + 0.1
                else
                    if utils.skeet_modules.vars.lag_compensation.timer > GlobalVars.curtime then
                        utils.skeet_modules.vars.lag_compensation.is_lc = true
                    else
                        utils.skeet_modules.vars.lag_compensation.is_lc = false
                    end
                end

                table.insert(indicator_list, {
                    type = "text",
                    text = (is_enabled(8) and utils.skeet_modules.vars.lag_compensation.is_lc) and "LC" or "",
                    color = my_index:GetVelocity() < 285 and Color.RGBA(255, 0, 0, 255) or Color.RGBA(132, 195, 16, 255)
                })

                local isFD = Menu.FindVar("Aimbot", "Anti Aim", "Misc", "Fake Duck"):GetBool()
                table.insert(indicator_list, {
                    type = "text",
                    text = (is_enabled(9) and isFD) and "DUCK" or "",
                    color = Color.RGBA(255, 255, 255, 255)
                })

                if is_enabled(10) then
                    local c4 = EntityList.GetEntitiesByClassID(129)[1]
                    if c4 then
                        if c4:GetProp("m_bBombTicking") and not c4:GetProp("m_bBombDefused") then
                            local get_damage = function()
                                local armor = my_index:GetProp("m_ArmorValue")
                                local health = my_index:GetProp("m_iHealth")

                                local c4_origin = c4:GetRenderOrigin()
                                local my_origin = my_index:GetRenderOrigin()
                                local distance = my_origin:DistTo(c4_origin)

                                local a, b, c = 450.7, 75.68, 789.2
                                local d = (distance - b) / c
                                local damage = a * math.exp(-d * d)

                                if armor > 0 then
                                    local new_damage = damage * 0.5
                                    local armor_damage = (damage - new_damage) * 0.5

                                    if armor_damage > armor then
                                        armor = armor * (1 / .5)
                                        new_damage = damage - armor_damage
                                    end

                                    damage = new_damage
                                end

                                return ({
                                    text = math.ceil(damage) >= health and "FATAL" or ("-%s HP"):format(math.ceil(damage)),
                                    color = math.ceil(damage) >= health and Color.RGBA(255, 0, 0, 255)
                                    or Color.RGBA(210, 216, 112, 255)
                                })
                            end

                            local current_site = utils.skeet_modules.vars.bomb_info.bombsite % 2 == 1 and "B" or "A"
                            local timer = c4:GetProp("m_flC4Blow") - GlobalVars.curtime

                            if timer > 0.1 then
                                local plant_info = ("%s - %ss"):format(current_site, ("%.1f"):format(timer))
                                table.insert(indicator_list, {
                                    type = "text",
                                    text = plant_info,
                                    color = Color.RGBA(255, 255, 255, 255)
                                })

                                local health_info = get_damage()
                                table.insert(indicator_list, {
                                    type = "text",
                                    text = health_info.text,
                                    color = health_info.color
                                })

                                if utils.skeet_modules.vars.bomb_info.is_defusing then
                                    local defuse_timer = c4:GetProp("m_flDefuseCountDown") - GlobalVars.curtime
                                    local defuse_length = c4:GetProp("m_flDefuseLength")
                                    local defuse_bar_length = ((screen_size.y - 50) / defuse_length) * defuse_timer
                                    local bar_color = timer > defuse_length and Color.RGBA(58, 191, 54, 120)
                                    or Color.RGBA(252, 18, 19, 120)

                                    Render.BoxFilled(
                                        Vector2.new(0, 0),
                                        Vector2.new(10, screen_size.y),
                                        Color.RGBA(25, 25, 25, 120)
                                    )

                                    Render.BoxFilled(
                                        Vector2.new(0, screen_size.y - defuse_bar_length),
                                        Vector2.new(10, screen_size.y),
                                        bar_color
                                    )

                                    Render.Box(
                                        Vector2.new(0, 0),
                                        Vector2.new(10, screen_size.y),
                                        Color.RGBA(25, 25, 25, 120)
                                    )
                                end
                            end
                        end
                    end

                    if utils.skeet_modules.vars.bomb_info.is_planting then
                        local current_site = utils.skeet_modules.vars.bomb_info.bombsite % 2 == 1 and "B" or "A"
                        local frac = easings.clamp(3.125 - (3.125 + utils.skeet_modules.vars.bomb_info.plant_time - GlobalVars.curtime), 0, 3.125)

                        table.insert(indicator_list, {
                            type = "circle",
 
                            fl_text = ("Bombsite %s"):format(current_site),
                            fl_color = Color.RGBA(234, 209, 138, 255),
 
                            x_pos = 16,
                            y_pos = 0,
                            size = 8,
                            color = Color.RGBA(255, 255, 255, 255),
                            value = (frac / 3.3) * 360
                        })
                    end
                end

                table.insert(indicator_list, {
                    type = "text",
                    text = (is_enabled(11) and Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap"):GetBool()) and "DT" or "",
                    color = Exploits.GetCharge() == 1 and Color.RGBA(255, 255, 255, 255) or Color.RGBA(255, 0, 0, 255)
                })

                for k, indicator in ipairs(indicator_list) do
                    if indicator.type == "text" then
                        if indicator.text ~= nil and indicator.text ~= "" then
                            render_indicator(
                                indicator.text,
                                indicator.color,
                                add_y
                            )
                        end
                    end

                    if indicator.type == "circle" then
                        if indicator.x_pos ~= "" then
                            render_indicator(
                                indicator.fl_text,
                                indicator.fl_color,
                                add_y
                            )

                            render_circle(
                                indicator.fl_text,
                                indicator.x_pos, indicator.y_pos, add_y,
                                indicator.size,
                                indicator.color,
                                indicator.value
                            )
                        end
                    end

                    if (indicator.text ~= nil and indicator.text ~= "") or (indicator.type == "circle" and indicator.x_pos ~= "") then
                        add_y = add_y - 35
                    end
                end
            end
        end
    end
end
Cheat.RegisterCallback("draw", side_skeet_indicators)
Cheat.RegisterCallback("event", load_bomb_modules)
 
Активность
Пока что здесь никого нет
Сверху Снизу