Подпишитесь на наш Telegram-канал, чтобы всегда быть в курсе важных обновлений! Перейти

Ищу скрипт [NL] Flying damage indicator

Пользователь
Пользователь
Статус
Оффлайн
Регистрация
7 Янв 2018
Сообщения
233
Реакции
34
Ищу подлетающий вверх индикатор дамага, который работает НА ВСЕХ. Только на локала не нужно
 
Ищу подлетающий вверх индикатор дамага, который работает НА ВСЕХ. Только на локала не нужно
проверить не смогу но ща с вт перепишу
flying damaga:
Expand Collapse Copy
local m_enable = Menu.Switch("1","Enable")

function lerp(a, b, c) return a+(b-a)*c end
local hits = []

function on_damage(e)
    if e:GetName() ~= "player_hurt" then return end
    local entity_attacker = EntityList.GetPlayerForUserID(e:GetInt("attacker"));
    local entity_attacked = EntityList.GetPlayerForUserID(e:GetInt("userid"));
    local hitgroup = e:GetInt("hitgroup")
    local damage = e:GetInt("dmg_health");
    local color = (hitgroup == 0) and Color.new(1,0.2,0.2,1) or Color.new(1,1,1,1)
    color.a = 0
    if (entity_attacker == EntityList.GetLocalPlayer() and entity_attacker ~= entity_attacked)
        for i = 1,#hits.length do
            if(hits[i].ent == entity_attacked)
                hits[i].damage = damage + hits[i].damage
                hits[i].alpha = 0
                hits[i].offset = 0
                return;
            end
        end
        local pos = entity_attacked:GetRenderOrigin()
        table.insert(hits,
            {
                ent = entity_attacked,
                hitbox = hitgroup,
                position = pos,
                damage = damage,
                color = color,
                offset = 0,
                toalphaup = true
            }
        );
    }
}

Cheat.RegisterCallback('events', on_damage)
function draw1()
    if not m_enable:Get() then return end
    for i = 0, #hits.length do
        if(hits[i].pos)then
            if(hits[i].toalphaup) then
                hits[i].color.a = math.ceil(lerp(hits[i].color.a,1350,4*GlobalVars.frametime))
                hits[i].toalphaup = hits[i].color.a < 1350
            else
                hits[i].color.a = math.floor(lerp(hits[i].color.a,0,2*GlobalVars.frametime))
            end
            local position = Render.WorldToScreen(hits[i].position)
            hits[i].color.a = math.min(255,hits[i].color.a/6)
            hits[i].offset = hits[i].offset+50*GlobalVars.frametime
            if(hits[i].color.a > 0) then
                Render.Text(
                    '-' .. hits[i].damage,
                    position,
                    hits[i].color,
                    12
                )
            else
                hits[i] = nil
            end
        end
    end
end
Cheat.RegisterCallback('draw', draw1)
 
проверить не смогу но ща с вт перепишу
flying damaga:
Expand Collapse Copy
local m_enable = Menu.Switch("1","Enable")

function lerp(a, b, c) return a+(b-a)*c end
local hits = []

function on_damage(e)
    if e:GetName() ~= "player_hurt" then return end
    local entity_attacker = EntityList.GetPlayerForUserID(e:GetInt("attacker"));
    local entity_attacked = EntityList.GetPlayerForUserID(e:GetInt("userid"));
    local hitgroup = e:GetInt("hitgroup")
    local damage = e:GetInt("dmg_health");
    local color = (hitgroup == 0) and Color.new(1,0.2,0.2,1) or Color.new(1,1,1,1)
    color.a = 0
    if (entity_attacker == EntityList.GetLocalPlayer() and entity_attacker ~= entity_attacked)
        for i = 1,#hits.length do
            if(hits[i].ent == entity_attacked)
                hits[i].damage = damage + hits[i].damage
                hits[i].alpha = 0
                hits[i].offset = 0
                return;
            end
        end
        local pos = entity_attacked:GetRenderOrigin()
        table.insert(hits,
            {
                ent = entity_attacked,
                hitbox = hitgroup,
                position = pos,
                damage = damage,
                color = color,
                offset = 0,
                toalphaup = true
            }
        );
    }
}

Cheat.RegisterCallback('events', on_damage)
function draw1()
    if not m_enable:Get() then return end
    for i = 0, #hits.length do
        if(hits[i].pos)then
            if(hits[i].toalphaup) then
                hits[i].color.a = math.ceil(lerp(hits[i].color.a,1350,4*GlobalVars.frametime))
                hits[i].toalphaup = hits[i].color.a < 1350
            else
                hits[i].color.a = math.floor(lerp(hits[i].color.a,0,2*GlobalVars.frametime))
            end
            local position = Render.WorldToScreen(hits[i].position)
            hits[i].color.a = math.min(255,hits[i].color.a/6)
            hits[i].offset = hits[i].offset+50*GlobalVars.frametime
            if(hits[i].color.a > 0) then
                Render.Text(
                    '-' .. hits[i].damage,
                    position,
                    hits[i].color,
                    12
                )
            else
                hits[i] = nil
            end
        end
    end
end
Cheat.RegisterCallback('draw', draw1)
это вроде на локал онли, да и переписывать очень лень под нл :с
 
это вроде на локал онли, да и переписывать очень лень под нл :с
дак я переписал под нл, и как понять не локал онли? тип когда любого хитают? ок
C-like:
Expand Collapse Copy
local m_enable = Menu.Switch("1","Enable",false)

function lerp(a, b, c) return a+(b-a)*c end
local hits = {}

function on_damage(e)
    if e:GetName() ~= "player_hurt" then return end
    local entity_attacker = EntityList.GetPlayerForUserID(e:GetInt("attacker"));
    local entity_attacked = EntityList.GetPlayerForUserID(e:GetInt("userid"));
    local hitgroup = e:GetInt("hitgroup")
    local damage = e:GetInt("dmg_health");
    local color = (hitgroup == 0) and Color.new(1,0.2,0.2,1) or Color.new(1,1,1,1)
    color.a = 0
    --if (entity_attacker == EntityList.GetLocalPlayer() and entity_attacker ~= entity_attacked) then
        for i = 1,#hits.length do
            if(hits[i].ent == entity_attacked)
                hits[i].damage = damage + hits[i].damage
                hits[i].alpha = 0
                hits[i].offset = 0
                return;
            end
        end
        local pos = entity_attacked:GetRenderOrigin()
        table.insert(hits,
            {
                ent = entity_attacked,
                hitbox = hitgroup,
                position = pos,
                damage = damage,
                color = color,
                offset = 0,
                toalphaup = true
            }
        );
    --end
end

Cheat.RegisterCallback('events', on_damage)
function draw1()
    if not m_enable:Get() then return end
    for i = 0, #hits.length do
        if(hits[i].pos)then
            if(hits[i].toalphaup) then
                hits[i].color.a = math.ceil(lerp(hits[i].color.a,1350,4*GlobalVars.frametime))
                hits[i].toalphaup = hits[i].color.a < 1350
            else
                hits[i].color.a = math.floor(lerp(hits[i].color.a,0,2*GlobalVars.frametime))
            end
            local position = Render.WorldToScreen(hits[i].position)
            hits[i].color.a = math.min(255,hits[i].color.a/6)
            hits[i].offset = hits[i].offset+50*GlobalVars.frametime
            if(hits[i].color.a > 0) then
                Render.Text(
                    '-' .. hits[i].damage,
                    position,
                    hits[i].color,
                    12
                )
            else
                hits[i] = nil
            end
        end
    end
end
Cheat.RegisterCallback('draw', draw1)
 
дак я переписал под нл, и как понять не локал онли? тип когда любого хитают? ок
C-like:
Expand Collapse Copy
local m_enable = Menu.Switch("1","Enable",false)

[QUOTE="Xissayala, post: 2569243, member: 490962"]
дак я переписал под нл, и как понять не локал онли? тип когда любого хитают? ок
[CODE=clike]local m_enable = Menu.Switch("1","Enable",false)

function lerp(a, b, c) return a+(b-a)*c end
local hits = {}

function on_damage(e)
    if e:GetName() ~= "player_hurt" then return end
    local entity_attacker = EntityList.GetPlayerForUserID(e:GetInt("attacker"));
    local entity_attacked = EntityList.GetPlayerForUserID(e:GetInt("userid"));
    local hitgroup = e:GetInt("hitgroup")
    local damage = e:GetInt("dmg_health");
    local color = (hitgroup == 0) and Color.new(1,0.2,0.2,1) or Color.new(1,1,1,1)
    color.a = 0
    --if (entity_attacker == EntityList.GetLocalPlayer() and entity_attacker ~= entity_attacked) then
        for i = 1,#hits.length do
            if(hits[i].ent == entity_attacked)
                hits[i].damage = damage + hits[i].damage
                hits[i].alpha = 0
                hits[i].offset = 0
                return;
            end
        end
        local pos = entity_attacked:GetRenderOrigin()
        table.insert(hits,
            {
                ent = entity_attacked,
                hitbox = hitgroup,
                position = pos,
                damage = damage,
                color = color,
                offset = 0,
                toalphaup = true
            }
        );
    --end
end

Cheat.RegisterCallback('events', on_damage)
function draw1()
    if not m_enable:Get() then return end
    for i = 0, #hits.length do
        if(hits[i].pos)then
            if(hits[i].toalphaup) then
                hits[i].color.a = math.ceil(lerp(hits[i].color.a,1350,4*GlobalVars.frametime))
                hits[i].toalphaup = hits[i].color.a < 1350
            else
                hits[i].color.a = math.floor(lerp(hits[i].color.a,0,2*GlobalVars.frametime))
            end
            local position = Render.WorldToScreen(hits[i].position)
            hits[i].color.a = math.min(255,hits[i].color.a/6)
            hits[i].offset = hits[i].offset+50*GlobalVars.frametime
            if(hits[i].color.a > 0) then
                Render.Text(
                    '-' .. hits[i].damage,
                    position,
                    hits[i].color,
                    12
                )
            else
                hits[i] = nil
            end
        end
    end
end
Cheat.RegisterCallback('draw', draw1)
[neverlose.cc][Lua] Error in "marker": [string "local m_enable = Menu.Switch..."]:41: attempt to get length of field 'length' (a nil value)
stack traceback:
[string "local m_enable = Menu.Switch..."]:41: in function <[string "local m_enable = Menu.Switch..."]:39>
lcjKE98x9TA.jpg

ну вот к примеру. я хитнул чувака на 10 хп, и он меня на 10 хп. тоже самое работает на всех игроков.
(особенно удобно при игре 2х2, 5х5, чтобы видеть как дают дамаг твои тиммейты/видеть как их ебашут)
 
[neverlose.cc][Lua] Error in "marker": [string "local m_enable = Menu.Switch..."]:41: attempt to get length of field 'length' (a nil value)
stack traceback:
[string "local m_enable = Menu.Switch..."]:41: in function <[string "local m_enable = Menu.Switch..."]:39>

lcjKE98x9TA.jpg

ну вот к примеру. я хитнул чувака на 10 хп, и он меня на 10 хп. тоже самое работает на всех игроков.
(особенно удобно при игре 2х2, 5х5, чтобы видеть как дают дамаг твои тиммейты/видеть как их ебашут)
бля забыл поменять, на
Код:
Expand Collapse Copy
local m_enable = Menu.Switch("1","Enable",false)

function lerp(a, b, c) return a+(b-a)*c end
local hits = {}

function on_damage(e)
    if e:GetName() ~= "player_hurt" then return end
    local entity_attacker = EntityList.GetPlayerForUserID(e:GetInt("attacker"));
    local entity_attacked = EntityList.GetPlayerForUserID(e:GetInt("userid"));
    local hitgroup = e:GetInt("hitgroup")
    local damage = e:GetInt("dmg_health");
    local color = (hitgroup == 0) and Color.new(1,0.2,0.2,1) or Color.new(1,1,1,1)
    color.a = 0
    --if (entity_attacker == EntityList.GetLocalPlayer() and entity_attacker ~= entity_attacked) then
        for i = 1,#hits do
            if(hits[i].ent == entity_attacked)
                hits[i].damage = damage + hits[i].damage
                hits[i].alpha = 0
                hits[i].offset = 0
                return;
            end
        end
        local pos = entity_attacked:GetRenderOrigin()
        table.insert(hits,
            {
                ent = entity_attacked,
                hitbox = hitgroup,
                position = pos,
                damage = damage,
                color = color,
                offset = 0,
                toalphaup = true
            }
        );
    --end
end

Cheat.RegisterCallback('events', on_damage)
function draw1()
    if not m_enable:Get() then return end
    for i = 0, #hits do
        if(hits[i].pos)then
            if(hits[i].toalphaup) then
                hits[i].color.a = math.ceil(lerp(hits[i].color.a,1350,4*GlobalVars.frametime))
                hits[i].toalphaup = hits[i].color.a < 1350
            else
                hits[i].color.a = math.floor(lerp(hits[i].color.a,0,2*GlobalVars.frametime))
            end
            local position = Render.WorldToScreen(hits[i].position)
            hits[i].color.a = math.min(255,hits[i].color.a/6)
            hits[i].offset = hits[i].offset+50*GlobalVars.frametime
            if(hits[i].color.a > 0) then
                Render.Text(
                    '-' .. hits[i].damage,
                    position,
                    hits[i].color,
                    12
                )
            else
                hits[i] = nil
            end
        end
    end
end
Cheat.RegisterCallback('draw', draw1)
 
бля забыл поменять, на
Код:
Expand Collapse Copy
local m_enable = Menu.Switch("1","Enable",false)

function lerp(a, b, c) return a+(b-a)*c end
local hits = {}

function on_damage(e)
    if e:GetName() ~= "player_hurt" then return end
    local entity_attacker = EntityList.GetPlayerForUserID(e:GetInt("attacker"));
    local entity_attacked = EntityList.GetPlayerForUserID(e:GetInt("userid"));
    local hitgroup = e:GetInt("hitgroup")
    local damage = e:GetInt("dmg_health");
    local color = (hitgroup == 0) and Color.new(1,0.2,0.2,1) or Color.new(1,1,1,1)
    color.a = 0
    --if (entity_attacker == EntityList.GetLocalPlayer() and entity_attacker ~= entity_attacked) then
        for i = 1,#hits do
            if(hits[i].ent == entity_attacked)
                hits[i].damage = damage + hits[i].damage
                hits[i].alpha = 0
                hits[i].offset = 0
                return;
            end
        end
        local pos = entity_attacked:GetRenderOrigin()
        table.insert(hits,
            {
                ent = entity_attacked,
                hitbox = hitgroup,
                position = pos,
                damage = damage,
                color = color,
                offset = 0,
                toalphaup = true
            }
        );
    --end
end

Cheat.RegisterCallback('events', on_damage)
function draw1()
    if not m_enable:Get() then return end
    for i = 0, #hits do
        if(hits[i].pos)then
            if(hits[i].toalphaup) then
                hits[i].color.a = math.ceil(lerp(hits[i].color.a,1350,4*GlobalVars.frametime))
                hits[i].toalphaup = hits[i].color.a < 1350
            else
                hits[i].color.a = math.floor(lerp(hits[i].color.a,0,2*GlobalVars.frametime))
            end
            local position = Render.WorldToScreen(hits[i].position)
            hits[i].color.a = math.min(255,hits[i].color.a/6)
            hits[i].offset = hits[i].offset+50*GlobalVars.frametime
            if(hits[i].color.a > 0) then
                Render.Text(
                    '-' .. hits[i].damage,
                    position,
                    hits[i].color,
                    12
                )
            else
                hits[i] = nil
            end
        end
    end
end
Cheat.RegisterCallback('draw', draw1)
[string "local m_enable = Menu.Switch..."]:42: in function <[string "local m_enable = Menu.Switch..."]:39>
[neverlose.cc][Lua] Error in "marker": [string "local m_enable = Menu.Switch..."]:42: attempt to index a nil value
stack traceback:
[string "local m_enable = Menu.Switch..."]:42: in function <[string "local m_enable = Menu.Switch..."]:39>
 
[string "local m_enable = Menu.Switch..."]:42: in function <[string "local m_enable = Menu.Switch..."]:39>
[neverlose.cc][Lua] Error in "marker": [string "local m_enable = Menu.Switch..."]:42: attempt to index a nil value
stack traceback:
[string "local m_enable = Menu.Switch..."]:42: in function <[string "local m_enable = Menu.Switch..."]:39>
Код:
Expand Collapse Copy
local m_enable = Menu.Switch("1","Enable",false)

function lerp(a, b, c) return a+(b-a)*c end
local hits = {}

function on_damage(e)
    if e:GetName() ~= "player_hurt" then return end
    local entity_attacker = EntityList.GetPlayerForUserID(e:GetInt("attacker"));
    local entity_attacked = EntityList.GetPlayerForUserID(e:GetInt("userid"));
    local hitgroup = e:GetInt("hitgroup")
    local damage = e:GetInt("dmg_health");
    local color = (hitgroup == 0) and Color.new(1,0.2,0.2,1) or Color.new(1,1,1,1)
    color.a = 0
    --if (entity_attacker == EntityList.GetLocalPlayer() and entity_attacker ~= entity_attacked) then
        for i = 1,#hits do
            if(hits[i].ent == entity_attacked)
                hits[i].damage = damage + hits[i].damage
                hits[i].alpha = 0
                hits[i].offset = 0
                return;
            end
        end
        local pos = entity_attacked:GetRenderOrigin()
        table.insert(hits,
            {
                ent = entity_attacked,
                hitbox = hitgroup,
                position = pos,
                damage = damage,
                color = color,
                offset = 0,
                toalphaup = true
            }
        );
    --end
end

Cheat.RegisterCallback('events', on_damage)
function draw1()
    if not m_enable:Get() then return end
    for i = 1, #hits do
        if(hits[i])then
        if(hits[i].position)then
            if(hits[i].toalphaup) then
                hits[i].color.a = math.ceil(lerp(hits[i].color.a,1350,4*GlobalVars.frametime))
                hits[i].toalphaup = hits[i].color.a < 1350
            else
                hits[i].color.a = math.floor(lerp(hits[i].color.a,0,2*GlobalVars.frametime))
            end
            local position = Render.WorldToScreen(hits[i].position)
            hits[i].color.a = math.min(255,hits[i].color.a/6)
            hits[i].offset = hits[i].offset+50*GlobalVars.frametime
            if(hits[i].color.a > 0) then
                Render.Text(
                    '-' .. hits[i].damage,
                    position,
                    hits[i].color,
                    12
                )
            else
                hits[i] = nil
            end
        end
        end
    end
end
Cheat.RegisterCallback('draw', draw1)
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Код:
Expand Collapse Copy
local m_enable = Menu.Switch("1","Enable",false)

function lerp(a, b, c) return a+(b-a)*c end
local hits = {}

function on_damage(e)
    if e:GetName() ~= "player_hurt" then return end
    local entity_attacker = EntityList.GetPlayerForUserID(e:GetInt("attacker"));
    local entity_attacked = EntityList.GetPlayerForUserID(e:GetInt("userid"));
    local hitgroup = e:GetInt("hitgroup")
    local damage = e:GetInt("dmg_health");
    local color = (hitgroup == 0) and Color.new(1,0.2,0.2,1) or Color.new(1,1,1,1)
    color.a = 0
    --if (entity_attacker == EntityList.GetLocalPlayer() and entity_attacker ~= entity_attacked) then
        for i = 1,#hits do
            if(hits[i].ent == entity_attacked)
                hits[i].damage = damage + hits[i].damage
                hits[i].alpha = 0
                hits[i].offset = 0
                return;
            end
        end
        local pos = entity_attacked:GetRenderOrigin()
        table.insert(hits,
            {
                ent = entity_attacked,
                hitbox = hitgroup,
                position = pos,
                damage = damage,
                color = color,
                offset = 0,
                toalphaup = true
            }
        );
    --end
end

Cheat.RegisterCallback('events', on_damage)
function draw1()
    if not m_enable:Get() then return end
    for i = 1, #hits do[ATTACH type="full"]198027[/ATTACH]
        if(hits[i])then
        if(hits[i].position)then
            if(hits[i].toalphaup) then
                hits[i].color.a = math.ceil(lerp(hits[i].color.a,1350,4*GlobalVars.frametime))
                hits[i].toalphaup = hits[i].color.a < 1350
            else
                hits[i].color.a = math.floor(lerp(hits[i].color.a,0,2*GlobalVars.frametime))
            end
            local position = Render.WorldToScreen(hits[i].position)
            hits[i].color.a = math.min(255,hits[i].color.a/6)
            hits[i].offset = hits[i].offset+50*GlobalVars.frametime
            if(hits[i].color.a > 0) then
                Render.Text(
                    '-' .. hits[i].damage,
                    position,
                    hits[i].color,
                    12
                )
            else
                hits[i] = nil
            end
        end
        end
    end
end
Cheat.RegisterCallback('draw', draw1)
на каждом челе оно просто суммируется + на 17 строке забыл then
на каждом челе оно просто суммируется + на 17 строке забыл then
 

Вложения

  • 1648821822940.png
    1648821822940.png
    22.8 KB · Просмотры: 56
Код:
Expand Collapse Copy
local m_enable = Menu.Switch("1","Enable",false)

function lerp(a, b, c) return a+(b-a)*c end
local hits = {}

function on_damage(e)
    if e:GetName() ~= "player_hurt" then return end
    local entity_attacker = EntityList.GetPlayerForUserID(e:GetInt("attacker"));
    local entity_attacked = EntityList.GetPlayerForUserID(e:GetInt("userid"));
    local hitgroup = e:GetInt("hitgroup")
    local damage = e:GetInt("dmg_health");
    local color = (hitgroup == 0) and Color.new(1,0.2,0.2,1) or Color.new(1,1,1,1)
    color.a = 0
    --if (entity_attacker == EntityList.GetLocalPlayer() and entity_attacker ~= entity_attacked) then
        for i = 1,#hits do
            if(hits[i].ent == entity_attacked)
                hits[i].damage = damage + hits[i].damage
                hits[i].alpha = 0
                hits[i].offset = 0
                return;
            end
        end
        local pos = entity_attacked:GetRenderOrigin()
        table.insert(hits,
            {
                ent = entity_attacked,
                hitbox = hitgroup,
                position = pos,
                damage = damage,
                color = color,
                offset = 0,
                toalphaup = true
            }
        );
    --end
end

Cheat.RegisterCallback('events', on_damage)
function draw1()
    if not m_enable:Get() then return end
    for i = 1, #hits do
        if(hits[i])then
        if(hits[i].position)then
            if(hits[i].toalphaup) then
                hits[i].color.a = math.ceil(lerp(hits[i].color.a,1350,4*GlobalVars.frametime))
                hits[i].toalphaup = hits[i].color.a < 1350
            else
                hits[i].color.a = math.floor(lerp(hits[i].color.a,0,2*GlobalVars.frametime))
            end
            local position = Render.WorldToScreen(hits[i].position)
            hits[i].color.a = math.min(255,hits[i].color.a/6)
            hits[i].offset = hits[i].offset+50*GlobalVars.frametime
            if(hits[i].color.a > 0) then
                Render.Text(
                    '-' .. hits[i].damage,
                    position,
                    hits[i].color,
                    12
                )
            else
                hits[i] = nil
            end
        end
        end
    end
end
Cheat.RegisterCallback('draw', draw1)
теперь работает, но надо добавить таймер на отключение, а еще обнулять дамаг который в тебя летит :)
 
теперь работает, но надо добавить таймер на отключение, а еще обнулять дамаг который в тебя летит :)
я ж говорю переписал с жс вантапа, мне сложно делать без дебага
 
Назад
Сверху Снизу