- Статус
- Оффлайн
- Регистрация
- 11 Ноя 2020
- Сообщения
- 1,376
- Реакции
- 445
демонстрация прикура (фоновая музыка MORGENSHTERN™, фирменная индикация позиции игроков MORGENSHTERN™ и легендарная озвучка игровых действий от MORGENSHTERN™ не входит в данную премиум луа)
ресурсы:
Пожалуйста, авторизуйтесь для просмотра ссылки.
, распаковывать в "steamapps/common/Counter-Strike Global Offensive"
Код:
local template = "Timeline 1_00108%03d.png"
local start = 4
local finish = 260
local images = {}
local images_loaded = false
client.delay_call(0.01, function()
for i = start, finish do
table.insert(images, renderer.load_png(readfile("smoke\\" .. string.format(template, i)), 1920, 1080))
end
images_loaded = true
end)
local total_frames = finish - start
local frame = -1
---@diagnostic disable-next-line: lowercase-global
function tick()
if frame >= total_frames then
frame = -1
end
if frame >= 0 then
frame = frame + 1
end
client.delay_call(1 / 60 --[[ 60 fps ]], tick)
end
tick()
local w, h = client.screen_size()
client.set_event_callback("paint", function()
if not images_loaded then
return
end
-- renderer.text(500, 10, frame >= 0 and 0 or 255, frame >= 0 and 255 or 0, 0, 255, "", 0, tostring(frame))
local image = images[frame]
if image then
renderer.texture(image, 0, 0, w, h, 255, 255, 255, 255, "f")
end
end)
client.set_event_callback('player_hurt', function(e)
local attacker_id = client.userid_to_entindex(e.attacker)
if attacker_id == nil or attacker_id ~= entity.get_local_player() then
return
end
if e.health <= 0 then
if frame == -1 then
frame = 0
end
end
end)