• Я зарабатываю 100 000 RUB / месяц на этом сайте!

    А знаешь как? Я всего-лишь публикую (создаю темы), а админ мне платит. Трачу деньги на мороженое, робуксы и сервера в Minecraft. А ещё на паль из Китая. 

    Хочешь так же? Пиши и узнавай условия: https://t.me/alex_redact
    Реклама: https://t.me/yougame_official

LUA скрипт [GS] Крутящийся прицел

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
31 Авг 2022
Сообщения
38
Реакции
8
Крутящийся эзотерический символ, использовавшийся в нацисткой Германии.
Архив svaston (картинки) переносите по пути: Counter-Strike Global Offensive\images_svat
Код:
Expand Collapse Copy
local images = require 'gamesense/images'
local csgo_weapons = require 'gamesense/csgo_weapons'
local bit = require 'bit'
local ffi = require 'ffi'
local frame = 0
local svaston = {}
client.exec("cl_crosshairalpha 0")
client.exec('snd_restart')
local sto = ui.new_combobox("LUA", "B", "Spin to", {"Left", "Right"})
local speed = ui.new_slider("LUA", "B", "swaston speed", 1, 10, 6)
for i = 0, 149 do
    svaston[i] = readfile("images_svat/2cef2747153c435d94cf6f5a239cf9e2shWJPaKmqo49teX3-"..tostring(i)..'.png')
end
function clamp(value, min, max)
    return math.min(math.max(value, min), max)
end
math.lerp = function(name, value, speed)
    return (name + (value - name) * speed/10)
end

local rr, rg, rb = 0, 0, 0

local function on_paint()
        local tickcount = globals.tickcount
    function rainbow(h, s, v)
    local r, g, b
    local h, s, v = tickcount() % 350 / 350, 1, 1, 1

    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 * 255, g * 255, b * 255
end
    rr, rg, rb = rainbow()
end  

local render = function()
    local scrsize = {client.screen_size()}
    local checked_frame = clamp(0, 149, frame)
    local image = images.load_png(svaston[math.floor(clamp(checked_frame, 0, 149))])
    image:draw(scrsize[1]/2-22, scrsize[2]/2-22, 45, 45, rr, rg, rb, 255)
end
local r_r = globals.realtime()
local fps_max, fps, fps_time = 0, 0, globals.realtime()
framing = function()
    if ui.get(sto) == "Right" then
        frame = frame < 149 and frame + 1*clamp(0, 5, ((ui.get(speed)*50)/fps)) or 0
    else
        frame = frame > 0 and frame -1*clamp(0, 5, ((ui.get(speed)*50)/fps)) or 149
    end
end

--sounds
ffi.cdef[[
    typedef struct {
        char pad_0[0x14];
        int m_nFlags;
        char pad_1[0x10];
        void* m_pParent;
        int m_nValue;
        float m_fValue;
        char* m_pszString;
    } ConVar;
]]

local previousAmmoCount = -1
local previousFire = -1

pcall(function()
    local ICvar = client.create_interface("vstdlib.dll", "VEngineCvar007")
    local findVar = ffi.cast("void*(__thiscall*)(void*, const char*)", ffi.cast("void***", ICvar)[0][15])
    local sv_cheats = ffi.cast("ConVar*", findVar(ICvar, "sv_cheats"))

    sv_cheats.m_nFlags = bit.band(sv_cheats.m_nFlags, bit.bnot(0x8000))
    sv_cheats.m_nValue = 1
    sv_cheats.m_fValue = 1
end)
--[[
client.set_event_callback("setup_command", function(event)
    if event.in_attack ~= 1 then
        return
    end

    local localPlayer = entity.get_local_player()
    local weaponEntity = entity.get_player_weapon(localPlayer)
    if not csgo_weapons(weaponEntity).is_gun then
        return
    end

    local currentAmmoCount = entity.get_prop(weaponEntity, "m_iClip1")
    local whenReadyToFire = entity.get_prop(weaponEntity, "m_flNextPrimaryAttack")
    if cvar.sv_infinite_ammo:get_int() ~= 1 then
        if not (currentAmmoCount < previousAmmoCount and whenReadyToFire > globals.curtime() and whenReadyToFire ~= previousFire) then
            previousAmmoCount = currentAmmoCount
            return
        end
    else
        if not (whenReadyToFire > globals.curtime() and whenReadyToFire ~= previousFire) then
            return
        end
    end
    previousFire = whenReadyToFire
    previousAmmoCount = currentAmmoCount

    local weaponName = csgo_weapons(weaponEntity).name:gsub("%s+", "")
    client.exec('snd_setmixer "Weapons1" vol 0')
    client.exec("play customweaponsounds/" .. weaponName)
end)
client.set_event_callback("aim_fire", function()
    local localPlayer = entity.get_local_player()
    local weaponEntity = entity.get_player_weapon(localPlayer)
    if not csgo_weapons(weaponEntity).is_gun then
        return
    end

    local weaponName = csgo_weapons(weaponEntity).name:gsub("%s+", "")
    client.exec('snd_setmixer "Weapons1" vol 0')
    client.exec("play customweaponsounds/" .. weaponName)
end)
client.set_event_callback("player_connect_full", function(event)
    if client.userid_to_entindex(event.userid) ~= entity.get_local_player() then
        return
    end
    client.exec('snd_restart')
end)]]
client.set_event_callback("paint", function()
    if r_r + 1/(ui.get(speed)*50) < globals.realtime() then framing() r_r = globals.realtime() end
    if fps_time + .125 < globals.realtime() then
        fps = fps_max
        fps_max = 0
        fps_time = globals.realtime()
    else
        fps_max = fps_max + 8
    end
    render()
    on_paint()
end)
client.set_event_callback("shutdown", function()
    client.exec("cl_crosshairalpha 255")
    --client.exec('snd_setmixer "Weapons1" vol 1')
end)
 

Вложения

Последнее редактирование модератором:
150 картинок, мы не ищем легких путей!
 
была уже луашка 100 лет назад... и без ебучих картинок
 
Через картинку, а бля для кого renderer функция?
 
Последнее редактирование:
Назад
Сверху Снизу