как сделать чтобы по нажатию чекбокса работал и функшион

  • 13
  • 1
как сделать чтобы по нажатию чекбокса работал индикатор мин дамаг по кнопке
Код:
local mindmg = menu.add_checkbox("visual", "dmg indicator")

local enabled = true

local screen_size = render.get_screen_size()
local x = screen_size.x / 1.99
local y = screen_size.y / 1.99

local main_font = render.create_font("smallest_pixel-7", 11, 1000)

local min_damage_a = menu.find("aimbot", "auto", "target overrides", "force min. damage")
local min_damage_s = menu.find("aimbot", "scout", "target overrides", "force min. damage")
local min_damage_d = menu.find("aimbot", "deagle", "target overrides", "force min. damage")
local min_damage_r = menu.find("aimbot", "revolver", "target overrides", "force min. damage")
local min_damage_p = menu.find("aimbot", "pistols", "target overrides", "force min. damage")
local min_damage_awp = menu.find("aimbot", "awp", "target overrides", "force min. damage")

local amount_auto = unpack(menu.find("aimbot", "auto", "target overrides", "force min. damage"))
local amount_scout = unpack(menu.find("aimbot", "scout", "target overrides", "force min. damage"))
local amount_awp = unpack(menu.find("aimbot", "awp", "target overrides", "force min. damage"))
local amount_deagle = unpack(menu.find("aimbot", "deagle", "target overrides", "force min. damage"))
local amount_revolver = unpack(menu.find("aimbot", "revolver", "target overrides", "force min. damage"))
local amount_pistol = unpack(menu.find("aimbot", "pistols", "target overrides", "force min. damage"))

local function getweapon()
    local local_player = entity_list.get_local_player()
    if local_player == nil then return end

    local weapon_name = nil

    if local_player:get_prop("m_iHealth") > 0 then

        local active_weapon = local_player:get_active_weapon()
        if active_weapon == nil then return end

        weapon_name = active_weapon:get_name()


    else return end

    return weapon_name

end

local function on_paint()
    if enabled then

        if menu.is_open() then return end

        if getweapon() == "ssg08" then
            if min_damage_s[2]:get() then
                render.text(main_font, tostring(amount_scout:get()), vec2_t(x, y - 16), color_t(255, 255, 255))
            end
        elseif getweapon() == "deagle" then
            if min_damage_d[2]:get() then
                render.text(main_font, tostring(amount_deagle:get()), vec2_t(x, y - 16), color_t(255, 255, 255))
            end
        elseif getweapon() == "revolver" then
            if min_damage_r[2]:get() then
                render.text(main_font, tostring(amount_revolver:get()), vec2_t(x, y - 16), color_t(255, 255, 255))
            end
        elseif getweapon() == "awp" then
            if min_damage_awp[2]:get() then
                render.text(main_font, tostring(amount_awp:get()), vec2_t(x, y - 16), color_t(255, 255, 255))
            end
        elseif getweapon() == "scar20" or getweapon() == "g3sg1" then
            if min_damage_a[2]:get() then
                render.text(main_font, tostring(amount_auto:get()), vec2_t(x, y - 16), color_t(255, 255, 255))
            end
        elseif getweapon() == "glock" or getweapon() == "p250" or getweapon() == "cz75a" or getweapon() == "usp-s" or getweapon() == "tec9" or getweapon() == "p2000" or getweapon() == "fiveseven" or getweapon() == "elite" then
            if min_damage_p[2]:get() then
                render.text(main_font, tostring(amount_pistol:get()), vec2_t(x, y - 16), color_t(255, 255, 255))
            end
        end
    end
end

callbacks.add(e_callbacks.PAINT, on_paint)
 
  • 29
  • 6
Ну тут три варианта. 1) Лучше изучить луа 2) Лучше изучить апи чита 3) Посмотреть сурсы других луашек. Надеюсь поможет
идеальным вариантом будет использовать сразу все три
 
  • LauX
  • Заблокирован
  • 676
  • 12
  • 233
Контакты для связи отсутствуют.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
либо
Lua:
if mindmg:get() then
 -- что тебе нужно
end
или же
Lua:
if not mindmg:get() then return end --т.е если не включен, то ничего не будет происходить
В идеале так. Правда этот супергений не указал то, на какой софт он луашку пишет
 
  • 119
  • 17
Damage override indicator near crosshair:
local checkbox = menu.add_checkbox("General", "Damage override amount indication")

local screen_size = render.get_screen_size()
local x = screen_size.x / 1.99
local y = screen_size.y / 1.99
local font = render.create_font("smallest_pixel-7", 11, 1000)

local damage_override_key_autosniper = menu.find("aimbot", "auto", "target overrides", "force min. damage")
local damage_override_key_scout = menu.find("aimbot", "scout", "target overrides", "force min. damage")
local damage_override_key_awp = menu.find("aimbot", "awp", "target overrides", "force min. damage")
local damage_override_key_deagle = menu.find("aimbot", "deagle", "target overrides", "force min. damage")
local damage_override_key_revolver = menu.find("aimbot", "revolver", "target overrides", "force min. damage")
local damage_override_key_pistol = menu.find("aimbot", "pistols", "target overrides", "force min. damage")

local damage_override_amount_autosniper = unpack(menu.find("aimbot", "auto", "target overrides", "force min. damage"))
local damage_override_amount_scout = unpack(menu.find("aimbot", "scout", "target overrides", "force min. damage"))
local damage_override_amount_awp = unpack(menu.find("aimbot", "awp", "target overrides", "force min. damage"))
local damage_override_amount_deagle = unpack(menu.find("aimbot", "deagle", "target overrides", "force min. damage"))
local damage_override_amount_revolver = unpack(menu.find("aimbot", "revolver", "target overrides", "force min. damage"))
local damage_override_amount_pistol = unpack(menu.find("aimbot", "pistols", "target overrides", "force min. damage"))

local function getweapon()
    local local_player = entity_list.get_local_player()

    if local_player == nil then return end
    local weapon_name = nil

    if local_player:get_prop("m_iHealth") > 0 then
        local active_weapon = local_player:get_active_weapon()

        if active_weapon == nil then return end
        weapon_name = active_weapon:get_name()

    else return end
    return weapon_name
end

local function indication()
    if checkbox:get() then

        if getweapon() == "scar20" or getweapon() == "g3sg1" then
            if damage_override_key_autosniper[2]:get() then
            render.text(font, tostring(damage_override_amount_auto:get()), vec2_t(x, y - 16), color_t(255, 255, 255))
        end

        elseif getweapon() == "ssg08" then
            if damage_override_key_scout[2]:get() then
                render.text(font, tostring(damage_override_amount_scout:get()), vec2_t(x, y - 16), color_t(255, 255, 255))
            end

        elseif getweapon() == "awp" then
            if damage_override_key_awp[2]:get() then
                render.text(font, tostring(damage_override_amount_awp:get()), vec2_t(x, y - 16), color_t(255, 255, 255))
            end

        elseif getweapon() == "deagle" then
            if mdamage_override_key_deagle[2]:get() then
                render.text(font, tostring(damage_override_amount_deagle:get()), vec2_t(x, y - 16), color_t(255, 255, 255))
            end

        elseif getweapon() == "revolver" then
            if damage_override_key_revolver[2]:get() then
                render.text(font, tostring(damage_override_amount_revolver:get()), vec2_t(x, y - 16), color_t(255, 255, 255))
            end

        elseif getweapon() == "glock" or getweapon() == "p250" or getweapon() == "cz75a" or getweapon() == "usp-s" or getweapon() == "tec9" or getweapon() == "p2000" or getweapon() == "fiveseven" or getweapon() == "elite" then
            if damage_override_key_pistol[2]:get() then
                render.text(font, tostring(damage_override_amount_pistol:get()), vec2_t(x, y - 16), color_t(255, 255, 255))

            end
        end
    end
end

callbacks.add(e_callbacks.PAINT, indication)
нужные тебе строки, были выделены, я сам писатель луа скриптов - НОВИЧОК ПОЛНЕЙШИЙ, прошу не судить строго я пытался помочь
 
Последнее редактирование:
  • LauX
  • Заблокирован
  • 676
  • 12
  • 233
Контакты для связи отсутствуют.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Damage override indicator near crosshair:
local checkbox = menu.add_checkbox("General", "Damage override amount indication")

local screen_size = render.get_screen_size()
local x = screen_size.x / 1.99
local y = screen_size.y / 1.99
local font = render.create_font("smallest_pixel-7", 11, 1000)

local damage_override_key_autosniper = menu.find("aimbot", "auto", "target overrides", "force min. damage")
local damage_override_key_scout = menu.find("aimbot", "scout", "target overrides", "force min. damage")
local damage_override_key_awp = menu.find("aimbot", "awp", "target overrides", "force min. damage")
local damage_override_key_deagle = menu.find("aimbot", "deagle", "target overrides", "force min. damage")
local damage_override_key_revolver = menu.find("aimbot", "revolver", "target overrides", "force min. damage")
local damage_override_key_pistol = menu.find("aimbot", "pistols", "target overrides", "force min. damage")

local damage_override_amount_autosniper = unpack(menu.find("aimbot", "auto", "target overrides", "force min. damage"))
local damage_override_amount_scout = unpack(menu.find("aimbot", "scout", "target overrides", "force min. damage"))
local damage_override_amount_awp = unpack(menu.find("aimbot", "awp", "target overrides", "force min. damage"))
local damage_override_amount_deagle = unpack(menu.find("aimbot", "deagle", "target overrides", "force min. damage"))
local damage_override_amount_revolver = unpack(menu.find("aimbot", "revolver", "target overrides", "force min. damage"))
local damage_override_amount_pistol = unpack(menu.find("aimbot", "pistols", "target overrides", "force min. damage"))

local function getweapon()
    local local_player = entity_list.get_local_player()

    if local_player == nil then return end
    local weapon_name = nil

    if local_player:get_prop("m_iHealth") > 0 then
        local active_weapon = local_player:get_active_weapon()

        if active_weapon == nil then return end
        weapon_name = active_weapon:get_name()

    else return end
    return weapon_name
end

local function indication()
    if checkbox:get() then

        if getweapon() == "scar20" or getweapon() == "g3sg1" then
            if damage_override_key_autosniper[2]:get() then
            render.text(font, tostring(damage_override_amount_auto:get()), vec2_t(x, y - 16), color_t(255, 255, 255))
        end

        elseif getweapon() == "ssg08" then
            if damage_override_key_scout[2]:get() then
                render.text(font, tostring(damage_override_amount_scout:get()), vec2_t(x, y - 16), color_t(255, 255, 255))
            end

        elseif getweapon() == "awp" then
            if damage_override_key_awp[2]:get() then
                render.text(font, tostring(damage_override_amount_awp:get()), vec2_t(x, y - 16), color_t(255, 255, 255))
            end

        elseif getweapon() == "deagle" then
            if mdamage_override_key_deagle[2]:get() then
                render.text(font, tostring(damage_override_amount_deagle:get()), vec2_t(x, y - 16), color_t(255, 255, 255))
            end

        elseif getweapon() == "revolver" then
            if damage_override_key_revolver[2]:get() then
                render.text(font, tostring(damage_override_amount_revolver:get()), vec2_t(x, y - 16), color_t(255, 255, 255))
            end

        elseif getweapon() == "glock" or getweapon() == "p250" or getweapon() == "cz75a" or getweapon() == "usp-s" or getweapon() == "tec9" or getweapon() == "p2000" or getweapon() == "fiveseven" or getweapon() == "elite" then
            if damage_override_key_pistol[2]:get() then
                render.text(font, tostring(damage_override_amount_pistol:get()), vec2_t(x, y - 16), color_t(255, 255, 255))

            end
        end
    end
end

callbacks.add(e_callbacks.PAINT, indication)
нужные тебе строки, были выделены, я сам писатель луа скриптов - НОВИЧОК ПОЛНЕЙШИЙ, прошу не судить строго я пытался помочь
Хочешь сказать, что код полностью твой?)
 
Сверху Снизу