JS-скрипт Ищу скрипт Grenade Warning (вырезать)

rosemary.lua
Забаненный
Статус
Оффлайн
Регистрация
26 Апр 2021
Сообщения
391
Реакции[?]
88
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
что вырезать, откуда вырезать
 
Начинающий
Статус
Оффлайн
Регистрация
9 Дек 2019
Сообщения
59
Реакции[?]
5
Поинты[?]
0
Держи
JavaScript:
UI.AddCheckbox("nade_warning");

//Nade warning
function nadeWarning(){
    if(!checkbox_states["nade_warning"] && !checkbox_states["molotov_timer"]) return;
    var grenades = Entity.GetEntitiesByClassID(9).concat(Entity.GetEntitiesByClassID(113)).concat(Entity.GetEntitiesByClassID(100));

    local = Entity.GetLocalPlayer();
    if (!local) return;
    
    if (!Entity.IsAlive(local)){
        const obs = Entity.GetProp(local, "CBasePlayer", "m_hObserverTarget");

        if (!Entity.IsValid(obs)) return;
        
        local = obs;
    }

    const origin = Entity.GetEyePosition(local);

    for (var i = 0; i < grenades.length; i++){
        const g = grenades[i];

        const destination = Entity.GetRenderOrigin(g);
        const distance = get_metric_distance(origin, destination);
        const is_he = Entity.GetClassID(g) === 9, is_inferno = Entity.GetClassID(g) === 100;
        

        if (distance > nade_tracer_max_dist) continue;

        const screen = Render.WorldToScreen(destination);

        const trace = Trace.Line(local, origin, destination);

        const is_safe = distance > (is_inferno ? 4 : 8) || trace[1] < 0.61;

        if(!is_he && !is_inferno) continue;

        if(is_he && Entity.GetProp(g, "CBaseCSGrenadeProjectile", "m_nExplodeEffectTickBegin")) continue;
        if(is_he && Entity.GetProp(g, "CBaseCSGrenadeProjectile", "m_hThrower") === local) continue;

        //If it is flashbang we skip it
        if(is_he && Entity.GetProp(g, "CBaseGrenade", "m_flDamage") === 100) continue;

        Render.FilledCircle(screen[0], screen[1] - 50, 30, !is_safe ? [225, 20, 20, 175 ] : [20, 20, 20, 175]);
        Render.String(screen[0], screen[1] - 75, 1, "!", [255, 250, 175, 200], 4);
        if(is_he && checkbox_states["nade_warning"]){
            var armor = Entity.GetProp(local, "CCSPlayerResource", "m_iArmor");
            var health = Entity.GetProp(local, "CBasePlayer", "m_iHealth");
            var x = origin[0] - destination[0];
            var y = origin[1] - destination[1];
            var z = origin[2] - destination[2];
            const distance = Math.sqrt(x * x + y * y + z * z);
            const a = 105.0;
            const b = 25.0;
            const c = 140.0;
            const d = (distance - b) / (c+1);
            var damage = (a - 18) * Math.exp(-d * d);
            if(armor > 0) {
                var newDmg = damage * 0.5;
                var armorDmg = (damage - newDmg) * 0.5;
 
                if(armorDmg > armor) {
                    armor = armor * (1 / 0.5);
                    newDmg = damage - armorDmg;
                }
                damage = newDmg;
            }
            damage = clamp(Math.ceil(damage) - 1, 0, 100);

            Render.String(screen[0], screen[1] - 40, 1, damage + " dmg", [232, 232, 232, 200], 3);
        }

        if (is_inferno && checkbox_states["molotov_timer"]){
            if(!checkbox_states["molotov_timer"]) return;
            const time = Entity.GetProp(g, "CInferno", "m_nFireEffectTickBegin") * Globals.TickInterval();
            const factor = clamp(((time + 7) - Globals.Curtime()) / 7, 0, 7);
            Render.String(screen[0], screen[1] - 40, 1, ((time + 7) - Globals.Curtime()).toFixed(1) + " s", [232, 232, 232, 200], 3);
            renderArc(screen[0], screen[1] - 50, 30, 32, -90, 360 * factor, [232, 232, 232, 200]);
        }
    }
}
Global.RegisterCallback("Draw", "nadeWarning");
 
горошек
Начинающий
Статус
Оффлайн
Регистрация
23 Фев 2021
Сообщения
173
Реакции[?]
26
Поинты[?]
4K
Держи
JavaScript:
UI.AddCheckbox("nade_warning");

//Nade warning
function nadeWarning(){
    if(!checkbox_states["nade_warning"] && !checkbox_states["molotov_timer"]) return;
    var grenades = Entity.GetEntitiesByClassID(9).concat(Entity.GetEntitiesByClassID(113)).concat(Entity.GetEntitiesByClassID(100));

    local = Entity.GetLocalPlayer();
    if (!local) return;
  
    if (!Entity.IsAlive(local)){
        const obs = Entity.GetProp(local, "CBasePlayer", "m_hObserverTarget");

        if (!Entity.IsValid(obs)) return;
      
        local = obs;
    }

    const origin = Entity.GetEyePosition(local);

    for (var i = 0; i < grenades.length; i++){
        const g = grenades[i];

        const destination = Entity.GetRenderOrigin(g);
        const distance = get_metric_distance(origin, destination);
        const is_he = Entity.GetClassID(g) === 9, is_inferno = Entity.GetClassID(g) === 100;
      

        if (distance > nade_tracer_max_dist) continue;

        const screen = Render.WorldToScreen(destination);

        const trace = Trace.Line(local, origin, destination);

        const is_safe = distance > (is_inferno ? 4 : 8) || trace[1] < 0.61;

        if(!is_he && !is_inferno) continue;

        if(is_he && Entity.GetProp(g, "CBaseCSGrenadeProjectile", "m_nExplodeEffectTickBegin")) continue;
        if(is_he && Entity.GetProp(g, "CBaseCSGrenadeProjectile", "m_hThrower") === local) continue;

        //If it is flashbang we skip it
        if(is_he && Entity.GetProp(g, "CBaseGrenade", "m_flDamage") === 100) continue;

        Render.FilledCircle(screen[0], screen[1] - 50, 30, !is_safe ? [225, 20, 20, 175 ] : [20, 20, 20, 175]);
        Render.String(screen[0], screen[1] - 75, 1, "!", [255, 250, 175, 200], 4);
        if(is_he && checkbox_states["nade_warning"]){
            var armor = Entity.GetProp(local, "CCSPlayerResource", "m_iArmor");
            var health = Entity.GetProp(local, "CBasePlayer", "m_iHealth");
            var x = origin[0] - destination[0];
            var y = origin[1] - destination[1];
            var z = origin[2] - destination[2];
            const distance = Math.sqrt(x * x + y * y + z * z);
            const a = 105.0;
            const b = 25.0;
            const c = 140.0;
            const d = (distance - b) / (c+1);
            var damage = (a - 18) * Math.exp(-d * d);
            if(armor > 0) {
                var newDmg = damage * 0.5;
                var armorDmg = (damage - newDmg) * 0.5;

                if(armorDmg > armor) {
                    armor = armor * (1 / 0.5);
                    newDmg = damage - armorDmg;
                }
                damage = newDmg;
            }
            damage = clamp(Math.ceil(damage) - 1, 0, 100);

            Render.String(screen[0], screen[1] - 40, 1, damage + " dmg", [232, 232, 232, 200], 3);
        }

        if (is_inferno && checkbox_states["molotov_timer"]){
            if(!checkbox_states["molotov_timer"]) return;
            const time = Entity.GetProp(g, "CInferno", "m_nFireEffectTickBegin") * Globals.TickInterval();
            const factor = clamp(((time + 7) - Globals.Curtime()) / 7, 0, 7);
            Render.String(screen[0], screen[1] - 40, 1, ((time + 7) - Globals.Curtime()).toFixed(1) + " s", [232, 232, 232, 200], 3);
            renderArc(screen[0], screen[1] - 50, 30, 32, -90, 360 * factor, [232, 232, 232, 200]);
        }
    }
}
Global.RegisterCallback("Draw", "nadeWarning");
не работает
 
Начинающий
Статус
Оффлайн
Регистрация
9 Дек 2019
Сообщения
59
Реакции[?]
5
Поинты[?]
0
Держи, это намного лучше будет

JavaScript:
UI.AddCheckbox("Grenade Warning");

//GRENADE WARNING
const clr = [
    text = [ 240, 240, 240, 255 ],
    main = [ 38, 38, 38, 160 ],
    back = [ 32, 32, 32, 255 ],
    high = [ 48, 48, 48, 255 ],
    red  = [ 240, 41, 41, 255 ],
]

var positions = [];
var trace = [];
var render = [];
var local = Entity.GetLocalPlayer();

function Clamp(v, min, max)
{
    return Math.max(Math.min(v, max), min);
}

/* ------------------------------------------------------ */

function ImportGrenades()
{
    var grenades = Entity.GetEntitiesByClassID(9).concat(Entity.GetEntitiesByClassID(114).concat(Entity.GetEntitiesByClassID(100)));
    for (e in grenades)
    {
        pass = false;
        for (g in positions)
        {
            if (positions[g][0] == grenades[e])
            {
                pass = true;
                continue;
            }
        }
        if (pass)
            continue;

        positions.push([grenades[e], Globals.Curtime(), [Entity.GetRenderOrigin(grenades[e])], Globals.Curtime()]);
    }
}

/* ------------------------------------------------------ */

function GrenadeWarning()
{
    var grenades = Entity.GetEntitiesByClassID(9).concat(Entity.GetEntitiesByClassID(114).concat(Entity.GetEntitiesByClassID(100)));

    if (!Entity.IsAlive(local)) { return; }
  
    for (g in grenades) {
        for (var i = 0; i < grenades.length; i++) {
          
            var g = grenades[i];
            var isInferno = Entity.GetClassID(g) === 100;
            var isHeGrenade = Entity.GetClassID(g) === 9;

            /* --------------- */

            function DistanceInFeets (origin, destination) {
                var sub = [destination[0] - origin[0], destination[1] - origin[1], destination[2] - origin[2]];
                return Math.round(Math.sqrt(sub[0] ** 2 + sub[1] ** 2 + sub[2] ** 2) / 12);
                //return Math.round(sub[0] + sub[1] + sub[2]); // Для измерения в юнитах
            }

            /* --------------- */

            var destination = Entity.GetRenderOrigin(g);
            var origin = Entity.GetEyePosition(local);
            var distance = DistanceInFeets(origin, destination);
            var screen = Render.WorldToScreen(destination);
            var isSafe = distance > (isInferno ? 15 : 20) || trace[1] < 0.61;

            /* --------------- */

            if (distance > 256) { continue; }

            if (isHeGrenade && Entity.GetProp (g, "CBaseCSGrenadeProjectile", "m_nExplodeEffectTickBegin")) { continue; }

            /* --------------- */

            Render.FilledRect (screen[0] + 16, screen[1] - 12, 48, 24, clr[1]);

            Render.Polygon ([ [ screen[0] + 8,  screen[1] - 1 ], [ screen[0] + 16, screen[1] - 8 ], [ screen[0] + 16, screen[1] + 8 ] ], clr[1]);

            Render.String (screen[0] + 36, screen[1] - 5, 0, Math.round(distance / 3.28) + " m", clr[0], 3);
            Render.String (screen[0] + 20, screen[1] - 6, 0, isHeGrenade ? "I" : "K", isSafe ? clr[0] : clr[4], 6);

            /* --------------- */

            const warning_stroke = false; // true для красной обводки при опасности

            Render.Line ( screen[0] + 8, screen[1], screen[0] + 16, screen[1] - 8, !isSafe && warning_stroke ? clr[4] : clr[3])
            Render.Line ( screen[0] + 8, screen[1], screen[0] + 16, screen[1] + 8, !isSafe && warning_stroke ? clr[4] : clr[3])

            Render.Line ( screen[0] + 16, screen[1] - 12, screen[0] + 16, screen[1] - 7, !isSafe && warning_stroke ? clr[4] : clr[3])
            Render.Line ( screen[0] + 16, screen[1] + 12, screen[0] + 16, screen[1] + 8, !isSafe && warning_stroke ? clr[4] : clr[3])

            Render.Line ( screen[0] + 16, screen[1] - 12, screen[0] + 64, screen[1] - 12, !isSafe && warning_stroke ? clr[4] : clr[3])
            Render.Line ( screen[0] + 16, screen[1] + 12, screen[0] + 64, screen[1] + 12, !isSafe && warning_stroke ? clr[4] : clr[3])
            Render.Line ( screen[0] + 64, screen[1] + 12, screen[0] + 64, screen[1] - 12, !isSafe && warning_stroke ? clr[4] : clr[3])
          
            /* --------------- */

            if (isInferno)
            {
                var time = Entity.GetProp(g, "CInferno", "m_nFireEffectTickBegin") * Globals.TickInterval();
                var factor = Clamp(((time + 7) - Globals.Curtime()) / 7, 0, 7);
  
                Render.FilledRect(screen[0] + 16, screen[1] + 10, 48, 2, clr[2]);
                Render.FilledRect(screen[0] + 16, screen[1] + 10, Math.trunc(factor * 48), 2, clr[4]);
            }
        }
    }
}

/* ------------------------------------------------------ */

function onDrawd()
{
    if(!Gval("Grenade Warning")) return;
    ImportGrenades();
    GrenadeWarning();
}

Cheat.RegisterCallback("Draw", "onDrawd");
 
горошек
Начинающий
Статус
Оффлайн
Регистрация
23 Фев 2021
Сообщения
173
Реакции[?]
26
Поинты[?]
4K
Держи, это намного лучше будет

JavaScript:
UI.AddCheckbox("Grenade Warning");

//GRENADE WARNING
const clr = [
    text = [ 240, 240, 240, 255 ],
    main = [ 38, 38, 38, 160 ],
    back = [ 32, 32, 32, 255 ],
    high = [ 48, 48, 48, 255 ],
    red  = [ 240, 41, 41, 255 ],
]

var positions = [];
var trace = [];
var render = [];
var local = Entity.GetLocalPlayer();

function Clamp(v, min, max)
{
    return Math.max(Math.min(v, max), min);
}

/* ------------------------------------------------------ */

function ImportGrenades()
{
    var grenades = Entity.GetEntitiesByClassID(9).concat(Entity.GetEntitiesByClassID(114).concat(Entity.GetEntitiesByClassID(100)));
    for (e in grenades)
    {
        pass = false;
        for (g in positions)
        {
            if (positions[g][0] == grenades[e])
            {
                pass = true;
                continue;
            }
        }
        if (pass)
            continue;

        positions.push([grenades[e], Globals.Curtime(), [Entity.GetRenderOrigin(grenades[e])], Globals.Curtime()]);
    }
}

/* ------------------------------------------------------ */

function GrenadeWarning()
{
    var grenades = Entity.GetEntitiesByClassID(9).concat(Entity.GetEntitiesByClassID(114).concat(Entity.GetEntitiesByClassID(100)));

    if (!Entity.IsAlive(local)) { return; }
 
    for (g in grenades) {
        for (var i = 0; i < grenades.length; i++) {
         
            var g = grenades[i];
            var isInferno = Entity.GetClassID(g) === 100;
            var isHeGrenade = Entity.GetClassID(g) === 9;

            /* --------------- */

            function DistanceInFeets (origin, destination) {
                var sub = [destination[0] - origin[0], destination[1] - origin[1], destination[2] - origin[2]];
                return Math.round(Math.sqrt(sub[0] ** 2 + sub[1] ** 2 + sub[2] ** 2) / 12);
                //return Math.round(sub[0] + sub[1] + sub[2]); // Для измерения в юнитах
            }

            /* --------------- */

            var destination = Entity.GetRenderOrigin(g);
            var origin = Entity.GetEyePosition(local);
            var distance = DistanceInFeets(origin, destination);
            var screen = Render.WorldToScreen(destination);
            var isSafe = distance > (isInferno ? 15 : 20) || trace[1] < 0.61;

            /* --------------- */

            if (distance > 256) { continue; }

            if (isHeGrenade && Entity.GetProp (g, "CBaseCSGrenadeProjectile", "m_nExplodeEffectTickBegin")) { continue; }

            /* --------------- */

            Render.FilledRect (screen[0] + 16, screen[1] - 12, 48, 24, clr[1]);

            Render.Polygon ([ [ screen[0] + 8,  screen[1] - 1 ], [ screen[0] + 16, screen[1] - 8 ], [ screen[0] + 16, screen[1] + 8 ] ], clr[1]);

            Render.String (screen[0] + 36, screen[1] - 5, 0, Math.round(distance / 3.28) + " m", clr[0], 3);
            Render.String (screen[0] + 20, screen[1] - 6, 0, isHeGrenade ? "I" : "K", isSafe ? clr[0] : clr[4], 6);

            /* --------------- */

            const warning_stroke = false; // true для красной обводки при опасности

            Render.Line ( screen[0] + 8, screen[1], screen[0] + 16, screen[1] - 8, !isSafe && warning_stroke ? clr[4] : clr[3])
            Render.Line ( screen[0] + 8, screen[1], screen[0] + 16, screen[1] + 8, !isSafe && warning_stroke ? clr[4] : clr[3])

            Render.Line ( screen[0] + 16, screen[1] - 12, screen[0] + 16, screen[1] - 7, !isSafe && warning_stroke ? clr[4] : clr[3])
            Render.Line ( screen[0] + 16, screen[1] + 12, screen[0] + 16, screen[1] + 8, !isSafe && warning_stroke ? clr[4] : clr[3])

            Render.Line ( screen[0] + 16, screen[1] - 12, screen[0] + 64, screen[1] - 12, !isSafe && warning_stroke ? clr[4] : clr[3])
            Render.Line ( screen[0] + 16, screen[1] + 12, screen[0] + 64, screen[1] + 12, !isSafe && warning_stroke ? clr[4] : clr[3])
            Render.Line ( screen[0] + 64, screen[1] + 12, screen[0] + 64, screen[1] - 12, !isSafe && warning_stroke ? clr[4] : clr[3])
         
            /* --------------- */

            if (isInferno)
            {
                var time = Entity.GetProp(g, "CInferno", "m_nFireEffectTickBegin") * Globals.TickInterval();
                var factor = Clamp(((time + 7) - Globals.Curtime()) / 7, 0, 7);
 
                Render.FilledRect(screen[0] + 16, screen[1] + 10, 48, 2, clr[2]);
                Render.FilledRect(screen[0] + 16, screen[1] + 10, Math.trunc(factor * 48), 2, clr[4]);
            }
        }
    }
}

/* ------------------------------------------------------ */

function onDrawd()
{
    if(!Gval("Grenade Warning")) return;
    ImportGrenades();
    GrenadeWarning();
}

Cheat.RegisterCallback("Draw", "onDrawd");
тоже не работает
 
Забаненный
Статус
Оффлайн
Регистрация
17 Ноя 2020
Сообщения
50
Реакции[?]
9
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
это вырезать не возможно бл@ть
 
Сверху Снизу