JS-скрипт [Onetap V4] New bombtimer and animation logs

Начинающий
Статус
Оффлайн
Регистрация
16 Янв 2022
Сообщения
55
Реакции[?]
15
Поинты[?]
1K

1656162229633.png1656162516528.png1656162539016.png
Буду рад узнать, что бы вам еще хотелось увидеть в Onetap
Пожалуйста, авторизуйтесь для просмотра ссылки.

JavaScript:
//gui elements
UI.AddSubTab( [ "Visuals","SUBTAB_MGR" ], "UI" );
var path = [ "Visuals","SUBTAB_MGR","UI","UI"];
var colorLogs = UI.AddColorPicker( path, "Color logs" );
var outlineColorLogs = UI.AddColorPicker( path, "Outline color logs" );
var backgroundBombTimerColor = UI.AddColorPicker( path, "Background bomb timer color" );

var logs = [];
var logsTime = [];
var logsAlpha = [];
var logsMove = [];
var shoot = 0;
var hurt = 0;
var missLog = false;

//ragebot info
var target;
var targetHitbox;
var targetHitchance;
var targetName;

function getHitboxName(index)
{
    var hitboxName = "";
    switch (index)
    {
        case 0:
            hitboxName = "head";
            break;
        case 1:
            hitboxName = "neck";
            break;
        case 2:
            hitboxName = "pelvis";
            break;
        case 3:
            hitboxName = "body";
            break;
        case 4:
            hitboxName = "thorax";
            break;
        case 5:
            hitboxName = "chest";
            break;
        case 6:
            hitboxName = "upper chest";
            break;
        case 7:
            hitboxName = "left thigh";
            break;
        case 8:
            hitboxName = "right thigh";
            break;
        case 9:
            hitboxName = "left calf";
            break;
        case 10:
            hitboxName = "right calf";
            break;
        case 11:
            hitboxName = "left foot";
            break;
        case 12:
            hitboxName = "right foot";
            break;
        case 13:
            hitboxName = "left hand";
            break;
        case 14:
            hitboxName = "right hand";
            break;
        case 15:
            hitboxName = "left upper arm";
            break;
        case 16:
            hitboxName = "left forearm";
            break;
        case 17:
            hitboxName = "Right upper arm";
            break;
        case 18:
            hitboxName = "right forearm";
            break;
        default:
            hitboxName = "none";
    }

    return hitboxName;
}

function renderLogs()
{
    if (Entity.IsValid( Entity.GetLocalPlayer(  ) ))
    {
        var font = Render.GetFont( "Verdana.ttf", 11, true);

        if (logs.length > 6)
        {
            logs.shift();
            logsTime.shift();
            logsMove.shift();
            logsAlpha.shift();
        }
   
        if (logsTime[0] + 7 < Globals.Curtime( ))
        {
            logsAlpha[0] -= Globals.Frametime() * 600;
            logsMove[0] -= Globals.Frametime() * 120    ;
         
            if(logsAlpha[0] < 0)
            {
                logs.shift();
                logsTime.shift();
                logsMove.shift();
                logsAlpha.shift();
            }
        }
   
        for(i = 0; i < logs.length; i++)
        {
            Render.String(logsMove[i] + 1, 6 + 15 * i, 0, logs[i], [UI.GetColor( outlineColorLogs )[0],
            UI.GetColor( outlineColorLogs )[1],UI.GetColor( outlineColorLogs )[2],logsAlpha[i]], font);
            Render.String(logsMove[i], 5 + 15 * i, 0, logs[i], [UI.GetColor( colorLogs )[0],
            UI.GetColor( colorLogs )[1],UI.GetColor( colorLogs )[2],logsAlpha[i]], font);
        }
    }
}

function getRagebotInfo()
{
    missLog = true;
    target = Event.GetInt("target_index");
    targetHitbox = Event.GetInt("hitbox");
    targetHitchance = Event.GetInt("hitchance");
    targetName = Entity.GetName(target);
    shoot++;
    missLog = false;
}

function addHitLogs()
{
    localPlayer = Entity.GetLocalPlayer();
    getAttacker = Event.GetInt("attacker");
    getDamage = Event.GetInt("dmg_health");
    attacker = Entity.GetEntityFromUserID( getAttacker );
    if(localPlayer == attacker)
    {
        logs.push("Registered shot in the " + getHitboxName(targetHitbox) + " of " + targetName + " with a " + targetHitchance + "% chance and damage " + getDamage);
        logsTime.push(Globals.Curtime( ));
        logsMove.push(5);
        logsAlpha.push(255);
        hurt++;
    }
}

function addMissLogs()
{
    if(hurt != shoot)
    {
        shoot = 0;
        hurt = 0;

        if (!missLog)
        {
            missLog = true;
            logs.push("Missed shot due to spread");
            logsTime.push(Globals.Curtime( ));
            logsMove.push(5);
            logsAlpha.push(255);
        }
    }
}

function bombTimer()
{
    if (Entity.IsValid( Entity.GetLocalPlayer(  ) ))
    {
        var screen = Render.GetScreenSize();
        var bombIcon = Render.GetFont("bomb.ttf", 42, true);
        var c4 = Entity.GetEntitiesByClassID(129)[0];
        if (c4 != undefined)
        {
            var bombTicking = Entity.GetProp(c4, "CPlantedC4", "m_bBombTicking");
            var bombDefuseTicking = Entity.GetProp(c4, "CPlantedC4", "m_hBombDefuser");
            var bombTimer = Entity.GetProp(c4, "CPlantedC4", "m_flC4Blow") - Globals.Curtime( );
            var defuseTimer = Entity.GetProp(c4, "CPlantedC4", "m_flDefuseCountDown") - Globals.Curtime( );
            var timer = bombDefuseTicking > 0 ? defuseTimer : bombTimer;
            var toCircleValid = bombDefuseTicking > 0 ? 36 : 9;
            var arcBombTimerColor = bombDefuseTicking > 0 ? defuseTimer > bombTimer ? [255, 0, 0, 255] : [97, 163, 255, 255] : [255, 255, 255, 255];
   
            if (bombTicking)
            {
                Render.FilledCircle( screen[0] / 2, screen[1] / 8, 50, UI.GetColor( backgroundBombTimerColor ));
                Render.String(screen[0] / 2 - Render.TextSize( "W", bombIcon)[0] / 2, screen[1] / 8 - Render.TextSize( "W", bombIcon)[1] / 2, 0, "W", [255,255,255,255], bombIcon)
                Render.Arc(screen[0] / 2, screen[1] / 8, 50, -90, toCircleValid * timer, 2, arcBombTimerColor)
            }
        }
    }
}

function drawList()
{
    renderLogs();
    addMissLogs();
    bombTimer();
}

Render.Arc = function(x, y, radius, start_angle, percent, thickness, color) {
    var precision = (2 * Math.PI) / 30;
    var step = Math.PI / 180;
    var inner = radius - thickness;
    var end_angle = (start_angle + percent) * step;
    var start_angle = (start_angle * Math.PI) / 180;

    for (; radius > inner; --radius) {
        for (var angle = start_angle; angle < end_angle; angle += precision) {
            var cx = Math.round(x + radius * Math.cos(angle));
            var cy = Math.round(y + radius * Math.sin(angle));

            var cx2 = Math.round(x + radius * Math.cos(angle + precision));
            var cy2 = Math.round(y + radius * Math.sin(angle + precision));

            Render.Line(cx, cy, cx2, cy2, color);
        }
    }
};

Cheat.RegisterCallback("Draw", "drawList")
Cheat.RegisterCallback("ragebot_fire", "getRagebotInfo")
Cheat.RegisterCallback("player_hurt", "addHitLogs")
 
Последнее редактирование:
Забаненный
Статус
Оффлайн
Регистрация
6 Июн 2022
Сообщения
35
Реакции[?]
11
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
норм,но бомбу выровняй
 
Сверху Снизу