[OTCv4] Hitlogs

Новичок
Статус
Оффлайн
Регистрация
23 Дек 2021
Сообщения
0
Реакции[?]
0
Поинты[?]
0
RU: Настройка данного JS-Scripts находиться в Visuals. Создателем данного JS-Scripts является Klient. Данная тема была взята с другого игрового форума. Приятной игры!
EU: The configuration of this JS-Scripts is located in Visuals. The creator of this JS-Scripts is Klient. This topic was taken from another gaming forum. Have a nice game!



JS:
Код:
/*

    name: Aimbot logs
    author: Klient#1690

*/

var notify = {}; var callbacks = {}; var hitlog = {}; var n_list = new Array; var bullets = new Array
var obj = {}; var n_index = 0

var angles = function(ang) {var degtorad = function(degrees) {return degrees / 180 * Math.PI;};var sp = Math.sin(degtorad(ang[0]));var sy = Math.sin(degtorad(ang[1]));var cp = Math.cos(degtorad(ang[0]));var cy = Math.cos(degtorad(ang[1]));return [cp * cy, cp * sy, -sp];}
var time_to_ticks = function(time) {return Math.round(time / Globals.TickInterval());}
var num_format = function(b) {var c=b%10;if(c==1 && b!=11){return b+'st'}else if(c==2 && b!=12){return b+'nd'}else if(c==3 && b!=13) {return b+'rd'}else{return b+'th'}}
var lerp = function(a, b, percentage) {return a + (b - a) * percentage;}
if (!String.prototype.format) {String.prototype.format = function () {var args = arguments; return this.replace(/{(\d+)}/g, function (match, number) {return typeof args[number] != 'undefined' ? args[number] : match;});};}

var menu_tab_items = ["Visuals", "Hitlog", "Hitlog"]; UI.AddSubTab(["Visuals", "SUBTAB_MGR"], "Hitlog")
hitlog.type = UI.AddMultiDropdown(menu_tab_items, "Htilog type", ["Onetap", "On screen"], 0)
hitlog.on_screen_color = UI.AddColorPicker(menu_tab_items, "On screen color")
hitlog.onetap_color = UI.AddColorPicker(menu_tab_items, "Onetap color")

notify.notification = function(text, ms) { n_index += 1; obj[n_index] = this; this.text = text; this.ms = ms; return obj[n_index] }
notify.create = function(text, ms) { return new notify.notification(text, ms) }
notify.notification.prototype.run = function() { n_list.push({"text": this.text, "ms": this.ms, "alpha": 0, "frametime": Globals.Frametime()}) }

notify.name = "onetap"
notify.render = function() {
    var font = Render.GetFont("Verdana.ttf", 10, true)
    var r = UI.GetColor(hitlog.on_screen_color)[0]; var g = UI.GetColor(hitlog.on_screen_color)[1]; var b = UI.GetColor(hitlog.on_screen_color)[2]; var a = 255

    var height_offset = 23
    var screen_size = Render.GetScreenSize(); screen_size = [screen_size[0], screen_size[1] - 150]

    if (n_list.length > 10) { n_list.shift() }
    for (var i = 0; i < n_list.length; i++) {
        var item = n_list[i]

        item.ms = item.ms - Globals.Frametime(); var time_left = item.ms
        item.alpha = lerp(item.alpha, time_left <= 0 ? 0 : 1, Globals.Frametime() * 8); var alpha = item.alpha

        var text = item.text
        var full_width = Render.TextSize("[" + notify.name + "] ", font)[0] + Render.TextSize(text, font)[0] + 20; var full_height = 40

        var x = (screen_size[0] / 2) - (full_width / 2); var y = (screen_size[1] - height_offset)

        Render.FilledRect(x, y, full_width, full_height, [0, 0, 0, 155 * alpha])
        Render.FilledRect(x, y, full_width, 2, [r, g, b, 255 * alpha])

        Render.String(x + 10, y + (full_height / 2) - (Render.TextSize("[" + notify.name + "]", font)[1] / 2) - 2, 0, "[" + notify.name + "]", [r, g, b, 255 * alpha], font)
        Render.String(x + 10 + Render.TextSize("[" + notify.name + "] ", font)[0], y + (full_height / 2) - (Render.TextSize("[" + notify.name + "]", font)[1] / 2) - 2, 0, text, [255, 255, 255, 255 * alpha], font)
        height_offset = height_offset + (full_height + 5) * alpha
    }
}

hitlog.shots = 1
hitlog.hitgroup_names = ["generic", "head", "chest", "stomach", "left arm", "right arm", "left leg", "right leg", "neck", "?", "gear"]
hitlog.weapon_to_verb = {"knife": "Knifed", "hegrenade": "Naded", "inferno": "Burned"}
hitlog.aim_data = {}; hitlog.bullet_impacts = new Array
hitlog.generate_flags = function(aim_data) { return [aim_data.self_choke > 1 ? 1 : 0, aim_data.velocity_modifier < 1.00 ? 1 : 0, aim_data.flags.exploit] }

hitlog.ragebot_fire = function() {
    hitlog.aim_data = {
        "hitgroup": Event.GetInt("hitbox"), "hit_chance": Event.GetInt("hitchance"), "target": Event.GetInt("target_index"),

        "handle_time": Globals.Realtime(),
        "self_choke": Globals.ChokedCommands(),

        "flags": {
            "exploit": Event.GetInt("exploit") || 0
        },

        "safety": Event.GetInt("safepoint"),

        "shot_pos": Entity.GetRenderOrigin(Entity.GetLocalPlayer()),
        "eye": Entity.GetEyePosition(Entity.GetLocalPlayer()),
        "view": Local.GetCameraAngles(),

        "velocity_modifier": Entity.GetProp(Entity.GetLocalPlayer(), "CCSPlayer", "m_flVelocityModifier"),
        "tick": Globals.Tickcount()
    }

    bullets.push({"tick": Entity.GetProp(Entity.GetLocalPlayer(), "CBasePlayer", "m_nTickBase"), "time": 0, "delay": time_to_ticks(Local.Latency()), "registered": false, "hit": false})
    hitlog.shots++
}

hitlog.bullet_impact = function() {
    if (Entity.GetEntityFromUserID(Event.GetInt("userid")) != Entity.GetLocalPlayer()) return

    if (hitlog.bullet_impacts.length > 150) {hitlog.bullet_impacts = new Array}
    hitlog.bullet_impacts.push({
        "tick": Globals.Tickcount(),
        "eye": Entity.GetEyePosition(Entity.GetLocalPlayer()),
        "shot": [Event.GetInt("x"), Event.GetInt("y"), Event.GetInt("z")]
    })

    var tick_count = Entity.GetProp(Entity.GetLocalPlayer(), "CBasePlayer", "m_nTickBase")
    for (var i = 0; i < bullets.length; i++) {
        if (!bullets[i].registered && bullets[i].tick + bullets[i].delay >= tick_count) { bullets[i].registered = true }
    }
}

hitlog.player_hurt = function() {
    if (Entity.GetEntityFromUserID(Event.GetInt("attacker")) != Entity.GetLocalPlayer()) return

    var tick_count = Entity.GetProp(Entity.GetLocalPlayer(), "CBasePlayer", "m_nTickBase")
    var shot_id = num_format((hitlog.shots % 15) + 1)

    var hgroup = hitlog.hitgroup_names[Event.GetInt("hitgroup")] || "?"
    var aimed_hgroup = hitlog.hitgroup_names[hitlog.aim_data.hitgroup] || "?"

    var target_name = Entity.GetName(Entity.GetEntityFromUserID(Event.GetInt("userid"))).toLowerCase()
    var hit_chance = Math.floor(hitlog.aim_data.hit_chance + 0.5)

    var pflags = hitlog.generate_flags(hitlog.aim_data)
    var hitstory = ((((Globals.Tickcount() * 1) - hitlog.aim_data.tick / 1000) / 10000) % 20).toFixed(3)

    var _verification = function() {
        var text = ""

        var hg_diff = hgroup != aimed_hgroup ? true : false
        if (hg_diff) {
            text = (" | mismatch: [ {0} ]").format(
                (function() {
                    var addr = ""
                    if (hg_diff) { addr = addr + (hg_diff ? "hitgroup: " + aimed_hgroup : "") }
                    return addr
                })()
            )
        }
        return text
    }

    var text = ("Registered {0} shot in {1}\'s {2} for {3} damage ( hitchance: {4}%% | safety: {5} | history(Δ): {6} | flags: {7}{8} )").format(
        shot_id, target_name, hgroup, Event.GetInt("dmg_health"),
        hit_chance, hitlog.aim_data.safety, hitstory, pflags, _verification()
    )

    if (hgroup == "generic" && hitlog.weapon_to_verb[Event.GetString("weapon")] != null) {
        text = ("{0} {1} for {2} damage ({3} remaining)").format(hitlog.weapon_to_verb[Event.GetString("weapon")], target_name, Event.GetInt("dmg_health"), Event.GetInt("health"))
    }

    if (UI.GetValue(hitlog.type) & (1 << 1)) { notify.create(text, 8).run() }
    if (UI.GetValue(hitlog.type) & (1 << 0)) {
        Cheat.PrintLog(text, [UI.GetColor(hitlog.onetap_color)[0], UI.GetColor(hitlog.onetap_color)[1], UI.GetColor(hitlog.onetap_color)[2], 255])
    }

    for (var i = 0; i < bullets.length; i++) {
        if (bullets[i].registered && !bullets[i].hit && bullets[i].tick + bullets[i].delay >= tick_count) { bullets[i].hit = true }
    }
}

hitlog.net_update_start = function() {
    for (var i = 0; i < bullets.length; i++) {
        if (!bullets[i].registered) continue
        bullets[i].time++;

        if (bullets[i].time >= bullets[i].delay) {
            if (!bullets[i].hit) {
                var shot_id = num_format((hitlog.shots % 15) + 1)
                var hgroup = hitlog.hitgroup_names[hitlog.aim_data.hitgroup] || "?"

                var target_name = Entity.GetName(hitlog.aim_data.target).toLowerCase()
                var hit_chance = Math.floor(hitlog.aim_data.hit_chance + 0.5)

                var pflags = hitlog.generate_flags(hitlog.aim_data)

                var text = ("Missed {0} shot at {1}\'s {2}({3}%%) due to spread ( safety: {4} | flags: {5} )").format(
                    shot_id, target_name, hgroup, hit_chance,
                    hitlog.aim_data.safety, pflags
                )

                if (UI.GetValue(hitlog.type) & (1 << 1)) { notify.create(text, 8).run() }
                if (UI.GetValue(hitlog.type) & (1 << 0)) {
                    Cheat.PrintLog(text, [UI.GetColor(hitlog.onetap_color)[0], UI.GetColor(hitlog.onetap_color)[1], UI.GetColor(hitlog.onetap_color)[2], 255])
                }
            }
            bullets.splice(i, 1)
        }
    }
}

callbacks.render_callbacks = {
    paint: function() {
        notify.render()
    },
    player_hurt: function() {
        hitlog.player_hurt()
    },
    ragebot_fire: function() {
        hitlog.ragebot_fire()
    },
    round_start: function() {
        (function() {
            hitlog.shots = 1
        })()
    },
    bullet_impact: function() {
        hitlog.bullet_impact()
    },
    net_update_start: function() {
        hitlog.net_update_start()
    }
}
Cheat.RegisterCallback("ragebot_fire", "callbacks.render_callbacks.ragebot_fire")
Cheat.RegisterCallback("player_hurt", "callbacks.render_callbacks.player_hurt")
Cheat.RegisterCallback("round_start", "callbacks.render_callbacks.round_start")
Cheat.RegisterCallback("FRAME_NET_UPDATE_START", "callbacks.render_callbacks.net_update_start")
Cheat.RegisterCallback("bullet_impact", "callbacks.render_callbacks.bullet_impact")
Cheat.RegisterCallback("Draw", "callbacks.render_callbacks.paint")
 
Похожие темы
Сверху Снизу