Вопрос Сделацте штобэ по кэнопке

душнила
Пользователь
Статус
Оффлайн
Регистрация
19 Июн 2019
Сообщения
254
Реакции[?]
45
Поинты[?]
6K
JavaScript:
UI.AddCheckBox("Dormant Aimbot");
UI.AddHotkey("Dormant Key");
function check(){
    // enenies arr
    var e = Entity.GetEnemies();
    // filter as only dormant, alive and hittable enemies
    var d = e.filter(function(e){
        return Entity.IsDormant(e) && Entity.IsAlive(e) && Trace.Bullet(Entity.GetLocalPlayer(), e, Entity.GetEyePosition(Entity.GetLocalPlayer()), va(Entity.GetRenderOrigin(e), [0, 0, 45]))[1] > 1;
    });
    // sort hittable by damage
    var c = d.sort(function(a, b){
        return Trace.Bullet(Entity.GetLocalPlayer(), a, Entity.GetEyePosition(Entity.GetLocalPlayer()), va(Entity.GetRenderOrigin(a), [0, 0, 45]))[1] - Trace.Bullet(Entity.GetLocalPlayer(), b, Entity.GetEyePosition(Entity.GetLocalPlayer()), va(Entity.GetRenderOrigin(b), [0, 0, 45]))[1];
    })[0];
    // if no enemies return
    if(!c) {
        return;
    }
    var weapon_index = Entity.GetWeapon(Entity.GetLocalPlayer());
    var m_flNextPrimaryAttack = Entity.GetProp(weapon_index,"DT_BaseCombatWeapon","m_flNextPrimaryAttack"); //gets time until next attack
    var viewangle = VectorAngles(subtract(va(Entity.GetRenderOrigin(c), [0, 0, 45]),Entity.GetEyePosition(Entity.GetLocalPlayer())));
    if(!can_shoot(Entity.GetLocalPlayer()))//checks if you can shoot
    {
        return;
    }

    Cheat.Print("active: " + UI.IsHotkeyActive("Script Items", "Dormant Key") + " value: " + UI.GetValue("Dormant Key") + "\n")
    if(UI.IsHotkeyActive("Script Items", "Dormant Key")){ // UI.GetValue("Dormant Key") // ["Rage", "General", "General", "Key assignment",
        Cheat.Print("can_shoot YES\n");
        if( Globals.Curtime() - m_flNextPrimaryAttack > 0.1){
        //UserCMD.SetViewAngles(viewangle, true)
        UserCMD.SetAngles(viewangle);
        //UserCMD.SetButtons((1 << 0) | UserCMD.GetButtons())
        var getbuttons = Entity.GetProp(Entity.GetLocalPlayer(),'CBasePlayer', 'm_fFlags');
        Cheat.ExecuteCommand("+attack");
        shot = true;
  
    
        dmg = Trace.Bullet(Entity.GetLocalPlayer(), c, Entity.GetEyePosition(Entity.GetLocalPlayer()), va(Entity.GetRenderOrigin(c), [0, 0, 45]))[1];
        // log shot
        Cheat.Print("Dormant aimed at " + Entity.GetName(c) + " for " + dmg + " dmg");
        }
    }
}
Сделайте чтобы когда нажимали на checkbox(Dormant Aimbot), то появлялся hotkey (Dormant key)
 
Nike.lua
Олдфаг
Статус
Оффлайн
Регистрация
13 Окт 2020
Сообщения
2,747
Реакции[?]
1,465
Поинты[?]
2K
JavaScript:
UI.AddCheckBox("Dormant Aimbot");
UI.AddHotkey("Dormant Key");
function check(){
    // enenies arr
    var e = Entity.GetEnemies();
    // filter as only dormant, alive and hittable enemies
    var d = e.filter(function(e){
        return Entity.IsDormant(e) && Entity.IsAlive(e) && Trace.Bullet(Entity.GetLocalPlayer(), e, Entity.GetEyePosition(Entity.GetLocalPlayer()), va(Entity.GetRenderOrigin(e), [0, 0, 45]))[1] > 1;
    });
    // sort hittable by damage
    var c = d.sort(function(a, b){
        return Trace.Bullet(Entity.GetLocalPlayer(), a, Entity.GetEyePosition(Entity.GetLocalPlayer()), va(Entity.GetRenderOrigin(a), [0, 0, 45]))[1] - Trace.Bullet(Entity.GetLocalPlayer(), b, Entity.GetEyePosition(Entity.GetLocalPlayer()), va(Entity.GetRenderOrigin(b), [0, 0, 45]))[1];
    })[0];
    // if no enemies return
    if(!c) {
        return;
    }
    var weapon_index = Entity.GetWeapon(Entity.GetLocalPlayer());
    var m_flNextPrimaryAttack = Entity.GetProp(weapon_index,"DT_BaseCombatWeapon","m_flNextPrimaryAttack"); //gets time until next attack
    var viewangle = VectorAngles(subtract(va(Entity.GetRenderOrigin(c), [0, 0, 45]),Entity.GetEyePosition(Entity.GetLocalPlayer())));
    if(!can_shoot(Entity.GetLocalPlayer()))//checks if you can shoot
    {
        return;
    }

    Cheat.Print("active: " + UI.IsHotkeyActive("Script Items", "Dormant Key") + " value: " + UI.GetValue("Dormant Key") + "\n")
    if(UI.IsHotkeyActive("Script Items", "Dormant Key")){ // UI.GetValue("Dormant Key") // ["Rage", "General", "General", "Key assignment",
        Cheat.Print("can_shoot YES\n");
        if( Globals.Curtime() - m_flNextPrimaryAttack > 0.1){
        //UserCMD.SetViewAngles(viewangle, true)
        UserCMD.SetAngles(viewangle);
        //UserCMD.SetButtons((1 << 0) | UserCMD.GetButtons())
        var getbuttons = Entity.GetProp(Entity.GetLocalPlayer(),'CBasePlayer', 'm_fFlags');
        Cheat.ExecuteCommand("+attack");
        shot = true;
 
   
        dmg = Trace.Bullet(Entity.GetLocalPlayer(), c, Entity.GetEyePosition(Entity.GetLocalPlayer()), va(Entity.GetRenderOrigin(c), [0, 0, 45]))[1];
        // log shot
        Cheat.Print("Dormant aimed at " + Entity.GetName(c) + " for " + dmg + " dmg");
        }
    }
}
Сделайте чтобы когда нажимали на checkbox(Dormant Aimbot), то появлялся hotkey (Dormant key)
JavaScript:
UI.AddCheckBox("Dormant Aimbot");
UI.AddHotkey("Dormant Key");
function menu() {
UI.SetEnabled('Script items', 'Dormant Key', UI.GetValue('Script items', 'Dormant Aimbot'))
}

Cheat.RegisterCallback('Draw', 'menu')
 function check(){
    // enenies arr
    var e = Entity.GetEnemies();
    // filter as only dormant, alive and hittable enemies
    var d = e.filter(function(e){
        return Entity.IsDormant(e) && Entity.IsAlive(e) && Trace.Bullet(Entity.GetLocalPlayer(), e, Entity.GetEyePosition(Entity.GetLocalPlayer()), va(Entity.GetRenderOrigin(e), [0, 0, 45]))[1] > 1;
    });
    // sort hittable by damage
    var c = d.sort(function(a, b){
        return Trace.Bullet(Entity.GetLocalPlayer(), a, Entity.GetEyePosition(Entity.GetLocalPlayer()), va(Entity.GetRenderOrigin(a), [0, 0, 45]))[1] - Trace.Bullet(Entity.GetLocalPlayer(), b, Entity.GetEyePosition(Entity.GetLocalPlayer()), va(Entity.GetRenderOrigin(b), [0, 0, 45]))[1];
    })[0];
    // if no enemies return
    if(!c) {
        return;
    }
    var weapon_index = Entity.GetWeapon(Entity.GetLocalPlayer());
    var m_flNextPrimaryAttack = Entity.GetProp(weapon_index,"DT_BaseCombatWeapon","m_flNextPrimaryAttack"); //gets time until next attack
    var viewangle = VectorAngles(subtract(va(Entity.GetRenderOrigin(c), [0, 0, 45]),Entity.GetEyePosition(Entity.GetLocalPlayer())));
    if(!can_shoot(Entity.GetLocalPlayer()))//checks if you can shoot
    {
        return;
    }

    Cheat.Print("active: " + UI.IsHotkeyActive("Script Items", "Dormant Key") + " value: " + UI.GetValue("Dormant Key") + "\n")
    if(UI.IsHotkeyActive("Script Items", "Dormant Key")){ // UI.GetValue("Dormant Key") // ["Rage", "General", "General", "Key assignment",
        Cheat.Print("can_shoot YES\n");
        if( Globals.Curtime() - m_flNextPrimaryAttack > 0.1){
        //UserCMD.SetViewAngles(viewangle, true)
        UserCMD.SetAngles(viewangle);
        //UserCMD.SetButtons((1 << 0) | UserCMD.GetButtons())
        var getbuttons = Entity.GetProp(Entity.GetLocalPlayer(),'CBasePlayer', 'm_fFlags');
        Cheat.ExecuteCommand("+attack");
        shot = true;
 
    
        dmg = Trace.Bullet(Entity.GetLocalPlayer(), c, Entity.GetEyePosition(Entity.GetLocalPlayer()), va(Entity.GetRenderOrigin(c), [0, 0, 45]))[1];
        // log shot
        Cheat.Print("Dormant aimed at " + Entity.GetName(c) + " for " + dmg + " dmg");
        }
    }
}
 
душнила
Пользователь
Статус
Оффлайн
Регистрация
19 Июн 2019
Сообщения
254
Реакции[?]
45
Поинты[?]
6K
JavaScript:
UI.AddCheckBox("Dormant Aimbot");
UI.AddHotkey("Dormant Key");
function menu() {
UI.SetEnabled('Script items', 'Dormant Key', UI.GetValue('Script items', 'Dormant Aimbot'))
}

Cheat.RegisterCallback('Draw', 'menu')
function check(){
    // enenies arr
    var e = Entity.GetEnemies();
    // filter as only dormant, alive and hittable enemies
    var d = e.filter(function(e){
        return Entity.IsDormant(e) && Entity.IsAlive(e) && Trace.Bullet(Entity.GetLocalPlayer(), e, Entity.GetEyePosition(Entity.GetLocalPlayer()), va(Entity.GetRenderOrigin(e), [0, 0, 45]))[1] > 1;
    });
    // sort hittable by damage
    var c = d.sort(function(a, b){
        return Trace.Bullet(Entity.GetLocalPlayer(), a, Entity.GetEyePosition(Entity.GetLocalPlayer()), va(Entity.GetRenderOrigin(a), [0, 0, 45]))[1] - Trace.Bullet(Entity.GetLocalPlayer(), b, Entity.GetEyePosition(Entity.GetLocalPlayer()), va(Entity.GetRenderOrigin(b), [0, 0, 45]))[1];
    })[0];
    // if no enemies return
    if(!c) {
        return;
    }
    var weapon_index = Entity.GetWeapon(Entity.GetLocalPlayer());
    var m_flNextPrimaryAttack = Entity.GetProp(weapon_index,"DT_BaseCombatWeapon","m_flNextPrimaryAttack"); //gets time until next attack
    var viewangle = VectorAngles(subtract(va(Entity.GetRenderOrigin(c), [0, 0, 45]),Entity.GetEyePosition(Entity.GetLocalPlayer())));
    if(!can_shoot(Entity.GetLocalPlayer()))//checks if you can shoot
    {
        return;
    }

    Cheat.Print("active: " + UI.IsHotkeyActive("Script Items", "Dormant Key") + " value: " + UI.GetValue("Dormant Key") + "\n")
    if(UI.IsHotkeyActive("Script Items", "Dormant Key")){ // UI.GetValue("Dormant Key") // ["Rage", "General", "General", "Key assignment",
        Cheat.Print("can_shoot YES\n");
        if( Globals.Curtime() - m_flNextPrimaryAttack > 0.1){
        //UserCMD.SetViewAngles(viewangle, true)
        UserCMD.SetAngles(viewangle);
        //UserCMD.SetButtons((1 << 0) | UserCMD.GetButtons())
        var getbuttons = Entity.GetProp(Entity.GetLocalPlayer(),'CBasePlayer', 'm_fFlags');
        Cheat.ExecuteCommand("+attack");
        shot = true;

   
        dmg = Trace.Bullet(Entity.GetLocalPlayer(), c, Entity.GetEyePosition(Entity.GetLocalPlayer()), va(Entity.GetRenderOrigin(c), [0, 0, 45]))[1];
        // log shot
        Cheat.Print("Dormant aimed at " + Entity.GetName(c) + " for " + dmg + " dmg");
        }
    }
}
Не ворк
 
Сверху Снизу