Вопрос Джс трэштолк

Олдфаг
Статус
Оффлайн
Регистрация
14 Сен 2018
Сообщения
5,780
Реакции[?]
1,665
Поинты[?]
9K
JavaScript:
const master_switch = UI.AddCheckbox("test"); // checkbox
const normal_killsays = ["1.", // bodyaim trashtalk
"2"]; // bodyaim trashtalk

const hs_killsays = ["1", // hs trashtalk
"2"]; // hs trashtalk

const on_player_death = function()
{
    if(UI.GetValue.apply(null, master_switch))
    {
        const attacker = Entity.GetEntityFromUserID(Event.GetInt("attacker"));
        if(Entity.IsLocalPlayer(attacker) && attacker != Entity.GetEntityFromUserID(Event.GetInt("userid")))
        {
            Cheat.ExecuteCommand("say " + (Event.GetInt("headshot") == 1 && Math.random() > 0.5 ? hs_killsays[Math.floor(Math.random() * hs_killsays.length)] : normal_killsays[Math.floor(Math.random() * normal_killsays.length)]));
        }
    }
};
Cheat.RegisterCallback("player_death", "on_player_death");
 
Сверху Снизу