Вопрос Помогите фиксануть код

$$$ V.i.P $$$
Пользователь
Статус
Оффлайн
Регистрация
22 Апр 2020
Сообщения
484
Реакции[?]
42
Поинты[?]
0
чтобы не крашил блэ и онли киллсаунд, а то я не смог вырезать рендер.
Код:
var lastkill = 0;
var kills = 0;
var headshot = false;
var badges = [];
function getRandomInt(min, max) {
  min = Math.ceil(min);
  max = Math.floor(max);
  return Math.floor(Math.random() * (max - min + 1)) + min;
}
function draw() {
    if(!World.GetServerString() || Entity.IsAlive(Entity.GetLocalPlayer()) == false) badges.length = 0;
    if(!World.GetServerString() || Entity.IsAlive(Entity.GetLocalPlayer()) == false) return;
    
    
    if (kills > 0 && Globals.Curtime() < (lastkill + 2) && headshot == false) {
    }
    else if (kills == 1 && Globals.Curtime() < (lastkill + 2) && headshot == true) {
    }
    
    if (Globals.Curtime() > (lastkill + 2) || kills > 1) {
        headshot = false;
    }
    if (badges.length > 0) {
        for (var i = badges.slice(-11).length, j = 0; i > 0; i-- , j++) {
            if (j > 11) {
              j = 0;
            }
            var badge = badges.slice(-11)[i - 1];
            if (badge.type == "headshot") RenderBadge = Render.AddTexture("");
            if (badge.type == "body") RenderBadge = Render.AddTexture("");
        }
        if (badges.length > 10) {
            badges.shift();
        }
    }
}
function onkill() {
    if(!World.GetServerString() || Entity.IsAlive(Entity.GetLocalPlayer()) == false) return;
    if(Entity.GetEntityFromUserID(Event.GetInt("attacker")) == Entity.GetLocalPlayer() && Entity.GetEntityFromUserID(Event.GetInt("userid")) != Entity.GetLocalPlayer()){
        kills++;
        lastkill = Globals.Curtime();
        random = getRandomInt(1,1);
        if (Event.GetInt("headshot") == 1) {
            if (random == 1) Cheat.ExecuteCommand("play Headshot.wav"); // Headshot
            headshot = true;
        }
        if (Event.GetInt("headshot") == 1) {
            badges.push({
            type: "headshot"
        });
        }
        else {
            badges.push({
            type: "body"
        });
        }
        if (kills == 1) Cheat.ExecuteCommand( "play First_blood.wav" ); // 1 kill
        else if (kills == 2 ) Cheat.ExecuteCommand("play MultiKill_2_BL.wav" ); // 2 kill
        else if (kills == 2 ) Cheat.ExecuteCommand("play MultiKill_2_GR.wav"); // 2 kills
        else if (kills == 2 ) Cheat.ExecuteCommand("play MultiKill_2_SP.wav"); // 2 kills
        else if (kills == 3 ) Cheat.ExecuteCommand("play Dominating.wav"); // 3 kills
        else if (kills == 3 ) Cheat.ExecuteCommand("play Bottomfeeder.wav"); // 3 kills
        else if (kills == 4 ) Cheat.ExecuteCommand("play Multikill.wav"); // 4 kills
        else if (kills == 4 ) Cheat.ExecuteCommand("play Rampage.wav"); // 4 kills
        else if (kills == 4 ) Cheat.ExecuteCommand("play KillingSpree.wav"); // 4 kills
        else if (kills == 5 ) Cheat.ExecuteCommand("play Monster_Kill.wav"); // 5 kills
        else if (kills == 5 ) Cheat.ExecuteCommand("play Unstoppble.wav"); // 5 kills
        else if (kills == 6 ) Cheat.ExecuteCommand("play UltraKill.wav"); // 6 kills
        else if (kills == 6 ) Cheat.ExecuteCommand("play Holyshit.wav"); // 6 kills
        else if (kills == 7 ) Cheat.ExecuteCommand("play Wicked_Sick.wav"); // 7 kills
    }
}

function round_pre() {
kills = 0;
}
Cheat.RegisterCallback("Draw", "draw");
Cheat.RegisterCallback("player_death", "onkill")
 Cheat.RegisterCallback("round_prestart","round_pre");
 
Сверху Снизу