душнила
-
Автор темы
- #1
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");
}
}
}