Aimbot Rework
This commit is contained in:
parent
5a3d12c2da
commit
e2d160473a
@ -15,11 +15,11 @@ static CatVar aimkey(CV_KEY, "aimbot_aimkey", "0", "Aimkey", "Aimkey. Look at Ai
|
|||||||
static CatEnum aimkey_modes_enum({ "DISABLED", "AIMKEY", "REVERSE", "TOGGLE" });
|
static CatEnum aimkey_modes_enum({ "DISABLED", "AIMKEY", "REVERSE", "TOGGLE" });
|
||||||
static CatVar aimkey_mode(aimkey_modes_enum, "aimbot_aimkey_mode", "1", "Aimkey mode", "DISABLED: aimbot is always active\nAIMKEY: aimbot is active when key is down\nREVERSE: aimbot is disabled when key is down\nTOGGLE: pressing key toggles aimbot");
|
static CatVar aimkey_mode(aimkey_modes_enum, "aimbot_aimkey_mode", "1", "Aimkey mode", "DISABLED: aimbot is always active\nAIMKEY: aimbot is active when key is down\nREVERSE: aimbot is disabled when key is down\nTOGGLE: pressing key toggles aimbot");
|
||||||
static CatVar autoshoot(CV_SWITCH, "aimbot_autoshoot", "1", "Autoshoot", "Shoot automatically when the target is locked, isn't compatible with 'Enable when attacking'");
|
static CatVar autoshoot(CV_SWITCH, "aimbot_autoshoot", "1", "Autoshoot", "Shoot automatically when the target is locked, isn't compatible with 'Enable when attacking'");
|
||||||
static CatEnum hitbox_mode_enum({ "AUTO-HEAD", "AUTO-CLOSEST", "STATIC" });
|
static CatEnum hitbox_mode_enum({ "AUTO", "AUTO-CLOSEST", "STATIC" });
|
||||||
static CatVar hitbox_mode(hitbox_mode_enum, "aimbot_hitboxmode", "0", "Hitbox Mode", "Defines hitbox selection mode");
|
static CatVar hitbox_mode(hitbox_mode_enum, "aimbot_hitboxmode", "0", "Hitbox Mode", "Defines hitbox selection mode");
|
||||||
static CatVar fov(CV_FLOAT, "aimbot_fov", "0", "Aimbot FOV", "FOV range for aimbot to lock targets. \"Smart FOV\" coming eventually.", 180.0f);
|
static CatVar fov(CV_FLOAT, "aimbot_fov", "0", "Aimbot FOV", "FOV range for aimbot to lock targets. \"Smart FOV\" coming eventually.", 180.0f);
|
||||||
static CatVar fovcircle_opacity(CV_FLOAT, "aimbot_fov_draw_opacity", "0.7", "FOV Circle Opacity", "Defines opacity of FOV circle", 0.0f, 1.0f);
|
static CatVar fovcircle_opacity(CV_FLOAT, "aimbot_fov_draw_opacity", "0.7", "FOV Circle Opacity", "Defines opacity of FOV circle", 0.0f, 1.0f);
|
||||||
|
// Selective and related
|
||||||
static CatEnum priority_mode_enum({ "SMART", "FOV", "DISTANCE", "HEALTH" });
|
static CatEnum priority_mode_enum({ "SMART", "FOV", "DISTANCE", "HEALTH" });
|
||||||
static CatVar priority_mode(priority_mode_enum, "aimbot_prioritymode", "0", "Priority mode", "Priority mode.\n"
|
static CatVar priority_mode(priority_mode_enum, "aimbot_prioritymode", "0", "Priority mode", "Priority mode.\n"
|
||||||
"SMART: Basically Auto-Threat. Will be tweakable eventually. "
|
"SMART: Basically Auto-Threat. Will be tweakable eventually. "
|
||||||
@ -35,6 +35,7 @@ static CatVar stickybot(CV_SWITCH, "aimbot_stickys", "0", "Aim Sticky", "Should
|
|||||||
static CatVar rageonly(CV_SWITCH, "aimbot_rage_only", "0", "Ignore non-rage targets", "Use playerlist to set up rage targets");
|
static CatVar rageonly(CV_SWITCH, "aimbot_rage_only", "0", "Ignore non-rage targets", "Use playerlist to set up rage targets");
|
||||||
static CatEnum teammates_enum({ "ENEMY ONLY", "TEAMMATE ONLY", "BOTH" });
|
static CatEnum teammates_enum({ "ENEMY ONLY", "TEAMMATE ONLY", "BOTH" });
|
||||||
static CatVar teammates(teammates_enum, "aimbot_teammates", "0", "Aim at teammates", "Use to choose which team/s to target");
|
static CatVar teammates(teammates_enum, "aimbot_teammates", "0", "Aim at teammates", "Use to choose which team/s to target");
|
||||||
|
// Other prefrences
|
||||||
static CatVar silent(CV_SWITCH, "aimbot_silent", "1", "Silent", "Your screen doesn't get snapped to the point where aimbot aims at");
|
static CatVar silent(CV_SWITCH, "aimbot_silent", "1", "Silent", "Your screen doesn't get snapped to the point where aimbot aims at");
|
||||||
static CatVar target_lock(CV_SWITCH, "aimbot_target_lock", "0", "Target Lock", "Keeps your previously chosen target untill target check fails");
|
static CatVar target_lock(CV_SWITCH, "aimbot_target_lock", "0", "Target Lock", "Keeps your previously chosen target untill target check fails");
|
||||||
static CatEnum hitbox_enum({
|
static CatEnum hitbox_enum({
|
||||||
@ -49,12 +50,8 @@ static CatVar max_range(CV_INT, "aimbot_maxrange", "0", "Max distance",
|
|||||||
"Max range for aimbot\n"
|
"Max range for aimbot\n"
|
||||||
"900-1100 range is efficient for scout/widowmaker engineer", 4096.0f);
|
"900-1100 range is efficient for scout/widowmaker engineer", 4096.0f);
|
||||||
static CatVar extrapolate(CV_SWITCH, "aimbot_extrapolate", "0", "Latency extrapolation", "(NOT RECOMMENDED) latency extrapolation");
|
static CatVar extrapolate(CV_SWITCH, "aimbot_extrapolate", "0", "Latency extrapolation", "(NOT RECOMMENDED) latency extrapolation");
|
||||||
static CatVar slowaim(CV_SWITCH, "aimbot_slow", "0", "Slow Aim", "Slowly moves your crosshair onto the target for more legit play\nDisables silent aimbot");
|
static CatVar slow_aim(CV_INT, "aimbot_slow", "0", "Slow Aim", "Slowly moves your crosshair onto the target for more legit play\nDisables silent aimbot", 1, 50);
|
||||||
static CatVar slowaim_smoothing(CV_INT, "aimbot_slow_smooth", "10", "Slow Aim Smooth", "How slow the slow aim's aiming should be", 50);
|
|
||||||
static CatVar slowaim_autoshoot(CV_INT, "aimbot_slow_autoshoot", "10", "Slow Aim Threshhold", "Distance to autoshoot while smooth aiming", 25);
|
|
||||||
static CatVar projectile_aimbot(CV_SWITCH, "aimbot_projectile", "1", "Projectile aimbot", "If you turn it off, aimbot won't try to aim with projectile weapons");
|
static CatVar projectile_aimbot(CV_SWITCH, "aimbot_projectile", "1", "Projectile aimbot", "If you turn it off, aimbot won't try to aim with projectile weapons");
|
||||||
static CatVar proj_fov(CV_SWITCH, "aimbot_proj_fovpred", "0", "Projectile FOV mode", "If disabled, FOV restrictions apply to current target position");
|
|
||||||
static CatVar proj_visibility(CV_SWITCH, "aimbot_proj_vispred", "0", "Projectile visibility prediction", "If enabled, projectile aimbot will perform additional visibility checking and won't try to predict enemies behind walls");
|
|
||||||
static CatVar proj_gravity(CV_FLOAT, "aimbot_proj_gravity", "0", "Projectile gravity",
|
static CatVar proj_gravity(CV_FLOAT, "aimbot_proj_gravity", "0", "Projectile gravity",
|
||||||
"Force override projectile gravity. Useful for debugging.", 1.0f);
|
"Force override projectile gravity. Useful for debugging.", 1.0f);
|
||||||
static CatVar proj_speed(CV_FLOAT, "aimbot_proj_speed", "0", "Projectile speed",
|
static CatVar proj_speed(CV_FLOAT, "aimbot_proj_speed", "0", "Projectile speed",
|
||||||
@ -64,12 +61,10 @@ static CatVar proj_speed(CV_FLOAT, "aimbot_proj_speed", "0", "Projectile speed",
|
|||||||
"cathook. Yet.");
|
"cathook. Yet.");
|
||||||
static CatVar huntsman_autoshoot(CV_FLOAT, "aimbot_huntsman_charge", "0.5", "Huntsman autoshoot", "Minimum charge for autoshooting with huntsman.\n"
|
static CatVar huntsman_autoshoot(CV_FLOAT, "aimbot_huntsman_charge", "0.5", "Huntsman autoshoot", "Minimum charge for autoshooting with huntsman.\n"
|
||||||
"Set it to 0.01 if you want to shoot as soon as you start pulling the arrow", 0.01f, 1.0f);
|
"Set it to 0.01 if you want to shoot as soon as you start pulling the arrow", 0.01f, 1.0f);
|
||||||
static CatVar huntsman_full_auto(CV_SWITCH, "aimbot_full_auto_huntsman", "1", "Auto Huntsman", "Autoshoot will pull huntsman's string");
|
|
||||||
static CatVar miss_chance(CV_FLOAT, "aimbot_miss_chance", "0", "Miss chance", "From 0 to 1. Aimbot will NOT aim in these % cases", 0.0f, 1.0f);
|
static CatVar miss_chance(CV_FLOAT, "aimbot_miss_chance", "0", "Miss chance", "From 0 to 1. Aimbot will NOT aim in these % cases", 0.0f, 1.0f);
|
||||||
// Debug vars
|
// Debug vars
|
||||||
static CatVar aimbot_debug(CV_SWITCH, "aimbot_debug", "0", "Aimbot Debug", "Display simple debug info for aimbot");
|
static CatVar aimbot_debug(CV_SWITCH, "aimbot_debug", "0", "Aimbot Debug", "Display simple debug info for aimbot");
|
||||||
static CatVar engine_projpred(CV_SWITCH, "debug_aimbot_engine_pp", "0", "Engine ProjPred");
|
static CatVar engine_projpred(CV_SWITCH, "debug_aimbot_engine_pp", "0", "Engine ProjPred");
|
||||||
|
|
||||||
// Followbot vars
|
// Followbot vars
|
||||||
static CatVar auto_spin_up(CV_SWITCH, "aimbot_spin_up", "0", "Auto Spin Up", "Spin up minigun if you can see target, useful for followbots");
|
static CatVar auto_spin_up(CV_SWITCH, "aimbot_spin_up", "0", "Auto Spin Up", "Spin up minigun if you can see target, useful for followbots");
|
||||||
static CatVar auto_zoom(CV_SWITCH, "aimbot_auto_zoom", "0", "Auto Zoom", "Automatically zoom in if you can see target, useful for followbots");
|
static CatVar auto_zoom(CV_SWITCH, "aimbot_auto_zoom", "0", "Auto Zoom", "Automatically zoom in if you can see target, useful for followbots");
|
||||||
@ -86,8 +81,7 @@ bool projectile_mode { false };
|
|||||||
float cur_proj_speed { 0.0f };
|
float cur_proj_speed { 0.0f };
|
||||||
float cur_proj_grav { 0.0f };
|
float cur_proj_grav { 0.0f };
|
||||||
// If slow aimbot allows autoshoot
|
// If slow aimbot allows autoshoot
|
||||||
bool slowCanShoot = false;
|
bool slow_can_shoot = false;
|
||||||
bool silent_huntsman { false };
|
|
||||||
|
|
||||||
// This array will store calculated projectile/hitscan predictions
|
// This array will store calculated projectile/hitscan predictions
|
||||||
// for current frame, to avoid performing them again
|
// for current frame, to avoid performing them again
|
||||||
@ -96,10 +90,9 @@ AimbotCalculatedData_s calculated_data_array[2048] {};
|
|||||||
// The main "loop" of the aimbot.
|
// The main "loop" of the aimbot.
|
||||||
void CreateMove() {
|
void CreateMove() {
|
||||||
PROF_SECTION(PT_aimbot_cm);
|
PROF_SECTION(PT_aimbot_cm);
|
||||||
|
|
||||||
// Check if aimbot is enabled
|
|
||||||
if (!enabled) return;
|
if (!enabled) return;
|
||||||
|
|
||||||
|
// Auto-Unzoom
|
||||||
if (auto_unzoom) {
|
if (auto_unzoom) {
|
||||||
if (g_pLocalPlayer->holding_sniper_rifle) {
|
if (g_pLocalPlayer->holding_sniper_rifle) {
|
||||||
if (g_pLocalPlayer->bZoomed) {
|
if (g_pLocalPlayer->bZoomed) {
|
||||||
@ -110,31 +103,20 @@ void CreateMove() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Refresh projectile info
|
// Refresh projectile info
|
||||||
int huntsman_ticks = 0;
|
|
||||||
projectile_mode = (GetProjectileData(g_pLocalPlayer->weapon(), cur_proj_speed, cur_proj_grav));
|
projectile_mode = (GetProjectileData(g_pLocalPlayer->weapon(), cur_proj_speed, cur_proj_grav));
|
||||||
if (proj_speed)
|
if (proj_speed)
|
||||||
cur_proj_speed = (float)proj_speed;
|
cur_proj_speed = (float)proj_speed;
|
||||||
if (proj_gravity)
|
if (proj_gravity)
|
||||||
cur_proj_grav = (float)proj_gravity;
|
cur_proj_grav = (float)proj_gravity;
|
||||||
|
|
||||||
// Attemt to reduce huntsman_ticks by 1 untill it reaches 0
|
|
||||||
if (huntsman_ticks) {
|
|
||||||
// Disable attack
|
|
||||||
g_pUserCmd->buttons |= IN_ATTACK;
|
|
||||||
// Returns 0 - Something higher than 0
|
|
||||||
huntsman_ticks = max(0, huntsman_ticks - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Save should aim info
|
|
||||||
// We do this as we need to pass whether the aimkey allows aiming to both the find target and aiming system. If we just call the func than toggle aimkey would break so we save it to a var to use it twice
|
// We do this as we need to pass whether the aimkey allows aiming to both the find target and aiming system. If we just call the func than toggle aimkey would break so we save it to a var to use it twice
|
||||||
bool aimkey_status = UpdateAimkey();
|
bool aimkey_status = UpdateAimkey();
|
||||||
|
|
||||||
// Refresh our best target
|
// Refresh our best target
|
||||||
CachedEntity* target = RetrieveBestTarget(aimkey_status);
|
CachedEntity* target = RetrieveBestTarget(aimkey_status);
|
||||||
|
if (CE_BAD(target) || !foundTarget) return;
|
||||||
|
|
||||||
// Check target for dormancy and if there even is a target at all
|
// Auto-zoom
|
||||||
if (CE_GOOD(target) && foundTarget) {
|
|
||||||
|
|
||||||
IF_GAME (IsTF()) {
|
IF_GAME (IsTF()) {
|
||||||
if (auto_zoom) {
|
if (auto_zoom) {
|
||||||
if (g_pLocalPlayer->holding_sniper_rifle) {
|
if (g_pLocalPlayer->holding_sniper_rifle) {
|
||||||
@ -146,64 +128,37 @@ void CreateMove() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_VISUALS == 1
|
#if ENABLE_VISUALS == 1
|
||||||
// Set target esp color to pink
|
|
||||||
hacks::shared::esp::SetEntityColor(target, colors::pink);
|
hacks::shared::esp::SetEntityColor(target, colors::pink);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Check if player can aim and if aimkey allows aiming
|
// Local player check + Aimkey
|
||||||
// We also preform a CanShoot check here per the old canshoot method
|
if (!ShouldAim() || !aimkey_status) return;
|
||||||
if (ShouldAim() && aimkey_status && GetCanAim(1)) {
|
|
||||||
|
|
||||||
// Check if player isnt using a huntsman
|
|
||||||
if (g_pLocalPlayer->weapon()->m_iClassID != CL_CLASS(CTFCompoundBow)) {
|
|
||||||
|
|
||||||
// We check if we need to do a canshoot check as we might want to shoot but not aim, so do that check here
|
|
||||||
if (GetCanAim(2)) {
|
|
||||||
// Check the flNextPrimaryAttack netvar to tell when to aim
|
|
||||||
if (CanShoot()) Aim(target);
|
|
||||||
} else {
|
|
||||||
// If settings dont allow canShoot check, then just aim
|
|
||||||
Aim(target);
|
|
||||||
}
|
|
||||||
// Attemt to auto-shoot
|
// Attemt to auto-shoot
|
||||||
if (CanAutoShoot()) g_pUserCmd->buttons |= IN_ATTACK;
|
DoAutoshoot();
|
||||||
|
|
||||||
// If player is using huntsman, we use a different system for autoshooting
|
// flNextPrimaryAttack meme
|
||||||
} else {
|
if (only_can_shoot) {
|
||||||
|
|
||||||
// Grab time when charge began
|
// Handle Compound bow
|
||||||
float begincharge = CE_FLOAT(g_pLocalPlayer->weapon(), netvar.flChargeBeginTime);
|
if (g_pLocalPlayer->weapon()->m_iClassID == CL_CLASS(CTFCompoundBow)) {
|
||||||
// Reset current charge count
|
static bool currently_charging_huntsman = false;
|
||||||
float charge = 0;
|
|
||||||
// If bow is not charged, reset the charge time keeper
|
// Hunstman started charging
|
||||||
if (begincharge != 0) {
|
if (CE_FLOAT(g_pLocalPlayer->weapon(), netvar.flChargeBeginTime) != 0)
|
||||||
charge = g_GlobalVars->curtime - begincharge;
|
currently_charging_huntsman = true;
|
||||||
// Keep the charge time keeper kept at 1 second
|
|
||||||
if (charge > 1.0f) charge = 1.0f;
|
// Huntsman was released
|
||||||
silent_huntsman = true;
|
if (!(g_pUserCmd->buttons & IN_ATTACK) && currently_charging_huntsman) {
|
||||||
}
|
currently_charging_huntsman = false;
|
||||||
// If current charge is equal to or more than the user limit allows, then release the huntsman
|
Aim(target);
|
||||||
if (charge >= (float)huntsman_autoshoot) {
|
} else return;
|
||||||
// Stop user attacking
|
|
||||||
g_pUserCmd->buttons &= ~IN_ATTACK;
|
// Not release type weapon
|
||||||
// temporarily stop the anti-aim to allow the projectile to pass due to attack not being used
|
} else if (CanShoot() && (g_pUserCmd->buttons & IN_ATTACK)) Aim(target);
|
||||||
hacks::shared::antiaim::SetSafeSpace(3);
|
} else
|
||||||
// If user shouldnt release hunstman, attack for user here
|
|
||||||
} else if (autoshoot && huntsman_full_auto) {
|
|
||||||
huntsman_ticks = 3;
|
|
||||||
g_pUserCmd->buttons |= IN_ATTACK;
|
|
||||||
}
|
|
||||||
// If player released the huntsman, aim here
|
|
||||||
if (!(g_pUserCmd->buttons & IN_ATTACK) && silent_huntsman) {
|
|
||||||
Aim(target);
|
Aim(target);
|
||||||
silent_huntsman = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If settings allow and slowaim is disabled, Use silent angles
|
|
||||||
if (silent && !slowaim) g_pLocalPlayer->bUseSilentAngles = true;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,17 +176,17 @@ bool ShouldAim() {
|
|||||||
if (g_pLocalPlayer->using_action_slot_item) return false;
|
if (g_pLocalPlayer->using_action_slot_item) return false;
|
||||||
|
|
||||||
IF_GAME (IsTF2()) {
|
IF_GAME (IsTF2()) {
|
||||||
// Check if Carrying A building
|
// Carrying A building?
|
||||||
if (CE_BYTE(g_pLocalPlayer->entity, netvar.m_bCarryingObject)) return false;
|
if (CE_BYTE(g_pLocalPlayer->entity, netvar.m_bCarryingObject)) return false;
|
||||||
// Check if deadringer out
|
// Deadringer out?
|
||||||
if (CE_BYTE(g_pLocalPlayer->entity, netvar.m_bFeignDeathReady)) return false;
|
if (CE_BYTE(g_pLocalPlayer->entity, netvar.m_bFeignDeathReady)) return false;
|
||||||
// If zoomed only is on, check if zoomed
|
// If zoomed only is on, check if zoomed
|
||||||
if (zoomed_only && g_pLocalPlayer->holding_sniper_rifle) {
|
if (zoomed_only && g_pLocalPlayer->holding_sniper_rifle) {
|
||||||
if (!g_pLocalPlayer->bZoomed && !(g_pUserCmd->buttons & IN_ATTACK)) return false;
|
if (!g_pLocalPlayer->bZoomed && !(g_pUserCmd->buttons & IN_ATTACK)) return false;
|
||||||
}
|
}
|
||||||
// Check if player is taunting
|
// Is taunting?
|
||||||
if (HasCondition<TFCond_Taunting>(g_pLocalPlayer->entity)) return false;
|
if (HasCondition<TFCond_Taunting>(g_pLocalPlayer->entity)) return false;
|
||||||
// Check if player is cloaked
|
// Is cloaked
|
||||||
if (IsPlayerInvisible(g_pLocalPlayer->entity)) return false;
|
if (IsPlayerInvisible(g_pLocalPlayer->entity)) return false;
|
||||||
// Disable aimbot with stickbomb launcher
|
// Disable aimbot with stickbomb launcher
|
||||||
if (g_pLocalPlayer->weapon()->m_iClassID == CL_CLASS(CTFPipebombLauncher)) return false;
|
if (g_pLocalPlayer->weapon()->m_iClassID == CL_CLASS(CTFPipebombLauncher)) return false;
|
||||||
@ -301,19 +256,18 @@ CachedEntity* RetrieveBestTarget(bool aimkey_state) {
|
|||||||
foundTarget = false;
|
foundTarget = false;
|
||||||
target_last = nullptr;
|
target_last = nullptr;
|
||||||
|
|
||||||
// Book keeping vars
|
|
||||||
float target_highest_score, scr;
|
float target_highest_score, scr;
|
||||||
CachedEntity* ent;
|
CachedEntity* ent;
|
||||||
CachedEntity* target_highest_ent = 0;
|
CachedEntity* target_highest_ent = 0;
|
||||||
target_highest_score = -256;
|
target_highest_score = -256;
|
||||||
// Loop that checks all ents whether it is a good target or not
|
|
||||||
for (int i = 0; i < HIGHEST_ENTITY; i++) {
|
for (int i = 0; i < HIGHEST_ENTITY; i++) {
|
||||||
ent = ENTITY(i);
|
ent = ENTITY(i);
|
||||||
// Check for null and dormant
|
if (CE_BAD(ent)) continue; // Check for null and dormant
|
||||||
if (CE_BAD(ent)) continue;
|
|
||||||
// Check whether the current ent is good enough to target
|
// Check whether the current ent is good enough to target
|
||||||
if (IsTargetStateGood(ent)) {
|
if (IsTargetStateGood(ent)) {
|
||||||
// Get a score for the entity
|
|
||||||
// Distance Priority, Uses this is melee is used
|
// Distance Priority, Uses this is melee is used
|
||||||
if (GetWeaponMode() == weaponmode::weapon_melee || (int)priority_mode == 2) {
|
if (GetWeaponMode() == weaponmode::weapon_melee || (int)priority_mode == 2) {
|
||||||
scr = 4096.0f - calculated_data_array[i].aim_position.DistTo(g_pLocalPlayer->v_Eye);
|
scr = 4096.0f - calculated_data_array[i].aim_position.DistTo(g_pLocalPlayer->v_Eye);
|
||||||
@ -332,9 +286,7 @@ CachedEntity* RetrieveBestTarget(bool aimkey_state) {
|
|||||||
}
|
}
|
||||||
// Compare the top score to our current ents score
|
// Compare the top score to our current ents score
|
||||||
if (scr > target_highest_score) {
|
if (scr > target_highest_score) {
|
||||||
// Set foundTarget status to true
|
|
||||||
foundTarget = true;
|
foundTarget = true;
|
||||||
// Save found target info to vars
|
|
||||||
target_highest_score = scr;
|
target_highest_score = scr;
|
||||||
target_highest_ent = ent;
|
target_highest_ent = ent;
|
||||||
}
|
}
|
||||||
@ -342,7 +294,7 @@ CachedEntity* RetrieveBestTarget(bool aimkey_state) {
|
|||||||
}
|
}
|
||||||
// Save the ent for future use with target lock
|
// Save the ent for future use with target lock
|
||||||
target_last = target_highest_ent;
|
target_last = target_highest_ent;
|
||||||
// When our for loop finishes, return our ent
|
|
||||||
return target_highest_ent;
|
return target_highest_ent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,27 +302,27 @@ CachedEntity* RetrieveBestTarget(bool aimkey_state) {
|
|||||||
bool IsTargetStateGood(CachedEntity* entity) {
|
bool IsTargetStateGood(CachedEntity* entity) {
|
||||||
PROF_SECTION(PT_aimbot_targetstatecheck);
|
PROF_SECTION(PT_aimbot_targetstatecheck);
|
||||||
|
|
||||||
// Check for Players
|
// Checks for Players
|
||||||
if (entity->m_Type == ENTITY_PLAYER) {
|
if (entity->m_Type == ENTITY_PLAYER) {
|
||||||
// Check if target is The local player
|
// Local player check
|
||||||
if (entity == LOCAL_E) return false;
|
if (entity == LOCAL_E) return false;
|
||||||
// Dont aim at dead player
|
// Dead
|
||||||
if (!entity->m_bAlivePlayer) return false;
|
if (!entity->m_bAlivePlayer) return false;
|
||||||
// Dont aim at teammates
|
// Teammates
|
||||||
if ((int)teammates != 2 && ((!entity->m_bEnemy && !teammates) || (entity->m_bEnemy && teammates))) return false;
|
if ((int)teammates != 2 && ((!entity->m_bEnemy && !teammates) || (entity->m_bEnemy && teammates))) return false;
|
||||||
// Check if player is too far away
|
// Distance
|
||||||
if (EffectiveTargetingRange()) {
|
if (EffectiveTargetingRange()) {
|
||||||
if (entity->m_flDistance > EffectiveTargetingRange()) return false;
|
if (entity->m_flDistance > EffectiveTargetingRange()) return false;
|
||||||
}
|
}
|
||||||
|
// Rage only check
|
||||||
if (rageonly) {
|
if (rageonly) {
|
||||||
if (playerlist::AccessData(entity).state != playerlist::k_EState::RAGE) {
|
if (playerlist::AccessData(entity).state != playerlist::k_EState::RAGE) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
IF_GAME (IsTF()) {
|
IF_GAME (IsTF()) {
|
||||||
// If settings allow waiting for charge, and current charge cant kill target, dont aim unless at 100% and the player wants to fire at 100% anyways
|
// Wait for charge
|
||||||
if (wait_for_charge && g_pLocalPlayer->holding_sniper_rifle) {
|
if (wait_for_charge && g_pLocalPlayer->holding_sniper_rifle) {
|
||||||
// Grab netvar for current charge damage and multiply by 3 for headshot
|
|
||||||
float cdmg = CE_FLOAT(LOCAL_W, netvar.flChargedDamage) * 3;
|
float cdmg = CE_FLOAT(LOCAL_W, netvar.flChargedDamage) * 3;
|
||||||
bool maxCharge = cdmg >= 450.0F;
|
bool maxCharge = cdmg >= 450.0F;
|
||||||
|
|
||||||
@ -394,14 +346,13 @@ bool IsTargetStateGood(CachedEntity* entity) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If settings allow, ignore taunting players
|
// Taunting
|
||||||
if (ignore_taunting && HasCondition<TFCond_Taunting>(entity)) return false;
|
if (ignore_taunting && HasCondition<TFCond_Taunting>(entity)) return false;
|
||||||
// Dont target invulnerable players, ex: uber, bonk
|
// Invulnerable players, ex: uber, bonk
|
||||||
if (IsPlayerInvulnerable(entity)) return false;
|
if (IsPlayerInvulnerable(entity)) return false;
|
||||||
// Checks for cloaked/deadringed players
|
// cloaked/deadringed players
|
||||||
if (ignore_cloak || ignore_deadringer) {
|
if (ignore_cloak || ignore_deadringer) {
|
||||||
if (IsPlayerInvisible(entity)) {
|
if (IsPlayerInvisible(entity)) {
|
||||||
// Determine whether cloaked player is using deadringer and checks user settings accordingly
|
|
||||||
// Item id for deadringer is 59 as of time of creation
|
// Item id for deadringer is 59 as of time of creation
|
||||||
if (HasWeapon(entity, 59)) {
|
if (HasWeapon(entity, 59)) {
|
||||||
if (ignore_deadringer) return false;
|
if (ignore_deadringer) return false;
|
||||||
@ -410,14 +361,14 @@ bool IsTargetStateGood(CachedEntity* entity) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If settings allow, dont target vaccinated players
|
// Vaccinator
|
||||||
if (g_pLocalPlayer->weapon_mode == weaponmode::weapon_hitscan || LOCAL_W->m_iClassID == CL_CLASS(CTFCompoundBow))
|
if (g_pLocalPlayer->weapon_mode == weaponmode::weapon_hitscan || LOCAL_W->m_iClassID == CL_CLASS(CTFCompoundBow))
|
||||||
if (ignore_vaccinator && HasCondition<TFCond_UberBulletResist>(entity)) return false;
|
if (ignore_vaccinator && HasCondition<TFCond_UberBulletResist>(entity)) return false;
|
||||||
}
|
}
|
||||||
// Dont target players marked as friendly
|
// Friendly player
|
||||||
if (playerlist::IsFriendly(playerlist::AccessData(entity).state)) return false;
|
if (playerlist::IsFriendly(playerlist::AccessData(entity).state)) return false;
|
||||||
IF_GAME (IsTF()) {
|
IF_GAME (IsTF()) {
|
||||||
// If settings allow, ignore hoovys
|
// Hoovys
|
||||||
if (ignore_hoovy && IsHoovy(entity)) {
|
if (ignore_hoovy && IsHoovy(entity)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -427,34 +378,30 @@ bool IsTargetStateGood(CachedEntity* entity) {
|
|||||||
AimbotCalculatedData_s& cd = calculated_data_array[entity->m_IDX];
|
AimbotCalculatedData_s& cd = calculated_data_array[entity->m_IDX];
|
||||||
cd.hitbox = hitbox;
|
cd.hitbox = hitbox;
|
||||||
|
|
||||||
// If VisCheck fails, dont target player
|
// Vis check + fov check
|
||||||
if (!VischeckPredictedEntity(entity)) return false;
|
if (!VischeckPredictedEntity(entity)) return false;
|
||||||
|
|
||||||
// Check if player is within fov. Fov check can be preformed as it is a minimal fps drop and it even needs to be predicted beforehand by the vischeck anyways
|
|
||||||
if ((float)fov > 0.0f && cd.fov > (float)fov) return false;
|
if ((float)fov > 0.0f && cd.fov > (float)fov) return false;
|
||||||
|
|
||||||
// Target passed the tests so return true
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Check for buildings
|
// Check for buildings
|
||||||
} else if (entity->m_Type == ENTITY_BUILDING) {
|
} else if (entity->m_Type == ENTITY_BUILDING) {
|
||||||
// Check if building aimbot is enabled
|
// Enabled check
|
||||||
if ( !(buildings_other || buildings_sentry) ) return false;
|
if ( !(buildings_other || buildings_sentry) ) return false;
|
||||||
// Check if enemy building
|
// Teammates, Even with friendly fire enabled, buildings can NOT be damaged
|
||||||
if (!entity->m_bEnemy) return false;
|
if (!entity->m_bEnemy) return false;
|
||||||
// Check if building is within range
|
// Distance
|
||||||
if (EffectiveTargetingRange()) {
|
if (EffectiveTargetingRange()) {
|
||||||
if (entity->m_flDistance > (int)EffectiveTargetingRange()) return false;
|
if (entity->m_flDistance > (int)EffectiveTargetingRange()) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If needed, Check if building type is allowed
|
// Building type
|
||||||
if (!(buildings_other && buildings_sentry)) {
|
if (!(buildings_other && buildings_sentry)) {
|
||||||
// Check if target is a sentrygun
|
// Check if target is a sentrygun
|
||||||
if (entity->m_iClassID == CL_CLASS(CObjectSentrygun)) {
|
if (entity->m_iClassID == CL_CLASS(CObjectSentrygun)) {
|
||||||
// If sentrys are not allowed, dont target
|
|
||||||
if (!buildings_sentry) return false;
|
if (!buildings_sentry) return false;
|
||||||
|
// Other
|
||||||
} else {
|
} else {
|
||||||
// If target is not a sentry, check if other buildings are allowed
|
|
||||||
if (!buildings_other) return false;
|
if (!buildings_other) return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -462,52 +409,45 @@ bool IsTargetStateGood(CachedEntity* entity) {
|
|||||||
// Grab the prediction var
|
// Grab the prediction var
|
||||||
AimbotCalculatedData_s& cd = calculated_data_array[entity->m_IDX];
|
AimbotCalculatedData_s& cd = calculated_data_array[entity->m_IDX];
|
||||||
|
|
||||||
// If VisCheck fails, dont target building
|
// Vis and fov checks
|
||||||
if (!VischeckPredictedEntity(entity)) return false;
|
if (!VischeckPredictedEntity(entity)) return false;
|
||||||
|
|
||||||
// Check if building is within fov
|
|
||||||
if ((float)fov > 0.0f && cd.fov > (float)fov) return false;
|
if ((float)fov > 0.0f && cd.fov > (float)fov) return false;
|
||||||
|
|
||||||
// Target passed the tests so return true
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Check for stickybombs
|
// Check for stickybombs
|
||||||
} else if (entity->m_iClassID == CL_CLASS(CTFGrenadePipebombProjectile)) {
|
} else if (entity->m_iClassID == CL_CLASS(CTFGrenadePipebombProjectile)) {
|
||||||
|
// Enabled
|
||||||
// Check if sticky aimbot is enabled
|
|
||||||
if (!stickybot) return false;
|
if (!stickybot) return false;
|
||||||
|
|
||||||
// Only hitscan weapons can break stickys so check for them.
|
// Only hitscan weapons can break stickys so check for them.
|
||||||
if (!(GetWeaponMode() == weapon_hitscan || GetWeaponMode() == weapon_melee)) return false;
|
if (!(GetWeaponMode() == weapon_hitscan || GetWeaponMode() == weapon_melee)) return false;
|
||||||
|
|
||||||
// Check if target is within range
|
// Distance
|
||||||
if (EffectiveTargetingRange()) {
|
if (EffectiveTargetingRange()) {
|
||||||
if (entity->m_flDistance > (int)EffectiveTargetingRange()) return false;
|
if (entity->m_flDistance > (int)EffectiveTargetingRange()) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if thrower is a teammate
|
// Teammates, Even with friendly fire enabled, stickys can NOT be destroied
|
||||||
if (!entity->m_bEnemy) return false;
|
if (!entity->m_bEnemy) return false;
|
||||||
|
|
||||||
// Check if target is a pipe bomb
|
// Check if target is a pipe bomb
|
||||||
if (CE_INT(entity, netvar.iPipeType) != 1) return false;
|
if (CE_INT(entity, netvar.iPipeType) != 1) return false;
|
||||||
|
|
||||||
// Check if target is still
|
// Moving Sticky?
|
||||||
if (!CE_VECTOR(entity, netvar.vVelocity).IsZero(1.0f)) return false;
|
if (!CE_VECTOR(entity, netvar.vVelocity).IsZero(1.0f)) return false;
|
||||||
|
|
||||||
// Grab the prediction var
|
// Grab the prediction var
|
||||||
AimbotCalculatedData_s& cd = calculated_data_array[entity->m_IDX];
|
AimbotCalculatedData_s& cd = calculated_data_array[entity->m_IDX];
|
||||||
|
|
||||||
// If VisCheck fails, dont target building
|
// Vis and fov check
|
||||||
if (!VischeckPredictedEntity(entity)) return false;
|
if (!VischeckPredictedEntity(entity)) return false;
|
||||||
|
|
||||||
// Check if building is within fov
|
|
||||||
if ((float)fov > 0.0f && cd.fov > (float)fov) return false;
|
if ((float)fov > 0.0f && cd.fov > (float)fov) return false;
|
||||||
|
|
||||||
// Target passed the tests so return true
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// If target is not player or building, return false
|
// Target not valid
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// An impossible error so just return false
|
// An impossible error so just return false
|
||||||
@ -525,39 +465,51 @@ void Aim(CachedEntity* entity) {
|
|||||||
// Dont aim at a bad entity
|
// Dont aim at a bad entity
|
||||||
if (CE_BAD(entity)) return;
|
if (CE_BAD(entity)) return;
|
||||||
|
|
||||||
// Create some vars
|
// Get angles
|
||||||
Vector angles, tr;
|
Vector tr = (PredictEntity(entity) - g_pLocalPlayer->v_Eye);
|
||||||
int hitbox;
|
Vector angles;
|
||||||
|
|
||||||
// Grab the targets vector, and vector it for the eye angles
|
|
||||||
tr = (PredictEntity(entity) - g_pLocalPlayer->v_Eye);
|
|
||||||
VectorAngles(tr, angles);
|
VectorAngles(tr, angles);
|
||||||
|
// Clamping is important
|
||||||
// Clamp angles
|
|
||||||
fClampAngle(angles);
|
fClampAngle(angles);
|
||||||
|
|
||||||
// Slow the aiming to the aim vector if true
|
// Slow aim
|
||||||
if (slowaim) slowAim(angles, g_pUserCmd->viewangles);
|
if (slow_aim) DoSlowAim(angles);
|
||||||
|
|
||||||
// Set angles
|
// Set angles
|
||||||
g_pUserCmd->viewangles = angles;
|
g_pUserCmd->viewangles = angles;
|
||||||
|
|
||||||
|
if (silent && !slow_aim) g_pLocalPlayer->bUseSilentAngles = true;
|
||||||
|
|
||||||
// Finish function
|
// Finish function
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A function to check whether player can autoshoot
|
// A function to check whether player can autoshoot
|
||||||
bool CanAutoShoot() {
|
void DoAutoshoot() {
|
||||||
|
|
||||||
// First check whether user settings allow autoshoot
|
// Enable check
|
||||||
if (autoshoot) {
|
if (!autoshoot) return;
|
||||||
|
|
||||||
|
// Handle Compound bow
|
||||||
|
if (g_pLocalPlayer->weapon()->m_iClassID == CL_CLASS(CTFCompoundBow)) {
|
||||||
|
|
||||||
|
// Grab time when charge began
|
||||||
|
float begincharge = CE_FLOAT(g_pLocalPlayer->weapon(), netvar.flChargeBeginTime);
|
||||||
|
|
||||||
|
// Release hunstman if over huntsmans limit
|
||||||
|
if (g_GlobalVars->curtime - begincharge >= (float)huntsman_autoshoot) {
|
||||||
|
g_pUserCmd->buttons &= ~IN_ATTACK;
|
||||||
|
hacks::shared::antiaim::SetSafeSpace(3);
|
||||||
|
|
||||||
|
// Pull string if charge isnt enough
|
||||||
|
} else
|
||||||
|
g_pUserCmd->buttons |= IN_ATTACK;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// A var for weapons not to use with autoshoot
|
|
||||||
static int forbiddenWeapons[] = { CL_CLASS(CTFCompoundBow), CL_CLASS(CTFKnife) };
|
|
||||||
int weapon_class;
|
|
||||||
bool attack = true;
|
bool attack = true;
|
||||||
|
|
||||||
// If your using a sniper rifle, are zoomed and cant headshot, then return false
|
// Rifle check
|
||||||
IF_GAME (IsTF()) {
|
IF_GAME (IsTF()) {
|
||||||
if (g_pLocalPlayer->clazz == tf_class::tf_sniper) {
|
if (g_pLocalPlayer->clazz == tf_class::tf_sniper) {
|
||||||
if (g_pLocalPlayer->holding_sniper_rifle) {
|
if (g_pLocalPlayer->holding_sniper_rifle) {
|
||||||
@ -566,31 +518,26 @@ bool CanAutoShoot() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if ambassador can headshot
|
// Ambassador check
|
||||||
IF_GAME (IsTF2()) {
|
IF_GAME (IsTF2()) {
|
||||||
if (IsAmbassador(g_pLocalPlayer->weapon())) {
|
if (IsAmbassador(g_pLocalPlayer->weapon())) {
|
||||||
// Check if ambasador can headshot
|
// Check if ambasador can headshot
|
||||||
if (!AmbassadorCanHeadshot()) return false;
|
if (!AmbassadorCanHeadshot()) attack = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't autoshoot with the knife or bow!
|
// Forbidden weapons check
|
||||||
weapon_class = g_pLocalPlayer->weapon()->m_iClassID;
|
if (g_pLocalPlayer->weapon()->m_iClassID == CL_CLASS(CTFKnife)) attack = false;
|
||||||
for (int i = 0; i < 2; i++) {
|
|
||||||
if (weapon_class == forbiddenWeapons[i]) {
|
|
||||||
attack = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Autoshoot breaks Slow aimbot, so use a workaround to detect when it can
|
// Autoshoot breaks with Slow aimbot, so use a workaround to detect when it can
|
||||||
if (slowaim && !slowCanShoot) attack = false;
|
if (slow_aim && !slow_can_shoot) attack = false;
|
||||||
|
|
||||||
// Return what
|
// Dont autoshoot without anything in clip
|
||||||
return attack;
|
if (CE_INT(g_pLocalPlayer->weapon(), netvar.m_iClip1) == 0) attack = false;
|
||||||
} else
|
|
||||||
// Return false due to setting not allowing autoshoot
|
if (attack) g_pUserCmd->buttons |= IN_ATTACK;
|
||||||
return false;
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Grab a vector for a specific ent
|
// Grab a vector for a specific ent
|
||||||
@ -598,9 +545,9 @@ const Vector& PredictEntity(CachedEntity* entity) {
|
|||||||
// Pull out predicted data
|
// Pull out predicted data
|
||||||
AimbotCalculatedData_s& cd = calculated_data_array[entity->m_IDX];
|
AimbotCalculatedData_s& cd = calculated_data_array[entity->m_IDX];
|
||||||
Vector& result = cd.aim_position;
|
Vector& result = cd.aim_position;
|
||||||
// If predicted vector has already been calculated this tick, then return it.
|
|
||||||
if (cd.predict_tick == tickcount) return result;
|
if (cd.predict_tick == tickcount) return result;
|
||||||
// If ent is a player, find a corresponding vector
|
|
||||||
|
// Players
|
||||||
if ((entity->m_Type == ENTITY_PLAYER)) {
|
if ((entity->m_Type == ENTITY_PLAYER)) {
|
||||||
// If using projectiles, predict a vector
|
// If using projectiles, predict a vector
|
||||||
if (projectile_mode) {
|
if (projectile_mode) {
|
||||||
@ -617,17 +564,15 @@ const Vector& PredictEntity(CachedEntity* entity) {
|
|||||||
else
|
else
|
||||||
GetHitbox(entity, cd.hitbox, result);
|
GetHitbox(entity, cd.hitbox, result);
|
||||||
}
|
}
|
||||||
// If ent is a building, find a corresponding vector
|
// Buildings
|
||||||
} else if (entity->m_Type == ENTITY_BUILDING) {
|
} else if (entity->m_Type == ENTITY_BUILDING) {
|
||||||
result = GetBuildingPosition(entity);
|
result = GetBuildingPosition(entity);
|
||||||
// If ent isnt a special type, just use origin
|
// Other
|
||||||
} else {
|
} else {
|
||||||
result = entity->m_vecOrigin;
|
result = entity->m_vecOrigin;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset the predicted tickcount for the ent
|
|
||||||
cd.predict_tick = tickcount;
|
cd.predict_tick = tickcount;
|
||||||
// Pre-Calculate fov and store to array
|
|
||||||
cd.fov = GetFov(g_pLocalPlayer->v_OrigViewangles, g_pLocalPlayer->v_Eye, result);
|
cd.fov = GetFov(g_pLocalPlayer->v_OrigViewangles, g_pLocalPlayer->v_Eye, result);
|
||||||
// Return the found vector
|
// Return the found vector
|
||||||
return result;
|
return result;
|
||||||
@ -639,40 +584,33 @@ int BestHitbox(CachedEntity* target) {
|
|||||||
// Switch based apon the hitbox mode set by the user
|
// Switch based apon the hitbox mode set by the user
|
||||||
switch ((int)hitbox_mode) {
|
switch ((int)hitbox_mode) {
|
||||||
case 0: { // AUTO-HEAD priority
|
case 0: { // AUTO-HEAD priority
|
||||||
// The best hitbox var
|
|
||||||
int preferred = hitbox;
|
int preferred = hitbox;
|
||||||
// Var to keep if we can bodyshot
|
bool headonly = false;// Var to keep if we can bodyshot
|
||||||
bool headonly = false;
|
|
||||||
// Save the local players current weapon to a var
|
|
||||||
int ci = g_pLocalPlayer->weapon()->m_iClassID;
|
|
||||||
IF_GAME (IsTF()) {
|
IF_GAME (IsTF()) {
|
||||||
// Set our default hitbox for pelvis
|
int ci = g_pLocalPlayer->weapon()->m_iClassID;
|
||||||
preferred = hitbox_t::pelvis;
|
preferred = hitbox_t::pelvis;
|
||||||
// If user is using a sniper rifle, Set headonly to whether we can headshot or not,
|
// Sniper rifle
|
||||||
if (g_pLocalPlayer->holding_sniper_rifle) {
|
if (g_pLocalPlayer->holding_sniper_rifle) {
|
||||||
headonly = CanHeadshot();
|
headonly = CanHeadshot();
|
||||||
// If player is using a compund bow, set headonly to true
|
// Hunstman
|
||||||
} else if (ci == CL_CLASS(CTFCompoundBow)) {
|
} else if (ci == CL_CLASS(CTFCompoundBow)) {
|
||||||
headonly = true;
|
headonly = true;
|
||||||
// If player is using an ambassador, set headonly to true
|
// Ambassador
|
||||||
} else if (IsAmbassador(g_pLocalPlayer->weapon())) {
|
} else if (IsAmbassador(g_pLocalPlayer->weapon())) {
|
||||||
// We only want to aim for the head if the ambassador can headshot
|
|
||||||
headonly = AmbassadorCanHeadshot();
|
headonly = AmbassadorCanHeadshot();
|
||||||
// 18 health is a good number to use as thats the usual minimum damage it can do with a bodyshot, but damage could potentially be higher
|
// 18 health is a good number to use as thats the usual minimum damage it can do with a bodyshot, but damage could potentially be higher
|
||||||
if (target->m_iHealth <= 18 || IsPlayerCritBoosted(g_pLocalPlayer->entity)) headonly = false;
|
if (target->m_iHealth <= 18 || IsPlayerCritBoosted(g_pLocalPlayer->entity)) headonly = false;
|
||||||
// If player is using a rocket based weapon, prefer the hip
|
// Rocket launcher
|
||||||
} else if (ci == CL_CLASS(CTFRocketLauncher) ||
|
} else if (ci == CL_CLASS(CTFRocketLauncher) ||
|
||||||
ci == CL_CLASS(CTFRocketLauncher_AirStrike) ||
|
ci == CL_CLASS(CTFRocketLauncher_AirStrike) ||
|
||||||
ci == CL_CLASS(CTFRocketLauncher_DirectHit) ||
|
ci == CL_CLASS(CTFRocketLauncher_DirectHit) ||
|
||||||
ci == CL_CLASS(CTFRocketLauncher_Mortar)) {
|
ci == CL_CLASS(CTFRocketLauncher_Mortar)) {
|
||||||
preferred = hitbox_t::hip_L;
|
preferred = hitbox_t::hip_L;
|
||||||
}
|
}
|
||||||
// If target is off the ground and local player is using projectile weapons other than the bow, use the higher hitbox, spine_3
|
// Airborn projectile
|
||||||
if (GetWeaponMode() == weaponmode::weapon_projectile) {
|
if (GetWeaponMode() == weaponmode::weapon_projectile) {
|
||||||
// Grab netvar for flags and save to a var
|
bool ground = CE_INT(target, netvar.iFlags) & (1 << 0);
|
||||||
int flags = CE_INT(target, netvar.iFlags);
|
|
||||||
// Extract ground var from flags
|
|
||||||
bool ground = (flags & (1 << 0));
|
|
||||||
if (!ground) {
|
if (!ground) {
|
||||||
if (g_pLocalPlayer->weapon()->m_iClassID != CL_CLASS(CTFCompoundBow)) {
|
if (g_pLocalPlayer->weapon()->m_iClassID != CL_CLASS(CTFCompoundBow)) {
|
||||||
preferred = hitbox_t::spine_3;
|
preferred = hitbox_t::spine_3;
|
||||||
@ -683,29 +621,24 @@ int BestHitbox(CachedEntity* target) {
|
|||||||
// Bodyshot handling
|
// Bodyshot handling
|
||||||
if (g_pLocalPlayer->holding_sniper_rifle) {
|
if (g_pLocalPlayer->holding_sniper_rifle) {
|
||||||
|
|
||||||
// Grab netvar for current charge damage
|
|
||||||
float cdmg = CE_FLOAT(LOCAL_W, netvar.flChargedDamage);
|
float cdmg = CE_FLOAT(LOCAL_W, netvar.flChargedDamage);
|
||||||
// Set our baseline bodyshot damage
|
|
||||||
float bdmg = 50;
|
float bdmg = 50;
|
||||||
// Darwins damage correction
|
// Darwins damage correction, protects against 15% of damage
|
||||||
if (HasDarwins(target)) {
|
if (HasDarwins(target)) {
|
||||||
// Darwins protects against 15% of damage
|
|
||||||
bdmg = (bdmg * .85) - 1;
|
bdmg = (bdmg * .85) - 1;
|
||||||
cdmg = (cdmg * .85) - 1;
|
cdmg = (cdmg * .85) - 1;
|
||||||
}
|
}
|
||||||
// Vaccinator damage correction
|
// Vaccinator damage correction, protects against 75% of damage
|
||||||
if (HasCondition<TFCond_UberBulletResist>(target)) {
|
if (HasCondition<TFCond_UberBulletResist>(target)) {
|
||||||
// Vac charge protects against 75% of damage
|
|
||||||
bdmg = (bdmg * .25) - 1;
|
bdmg = (bdmg * .25) - 1;
|
||||||
cdmg = (cdmg * .25) - 1;
|
cdmg = (cdmg * .25) - 1;
|
||||||
} else if (HasCondition<TFCond_SmallBulletResist>(target)) {
|
|
||||||
// Passive bullet resist protects against 10% of damage
|
// Passive bullet resist protects against 10% of damage
|
||||||
|
} else if (HasCondition<TFCond_SmallBulletResist>(target)) {
|
||||||
bdmg = (bdmg * .90) - 1;
|
bdmg = (bdmg * .90) - 1;
|
||||||
cdmg = (cdmg * .90) - 1;
|
cdmg = (cdmg * .90) - 1;
|
||||||
}
|
}
|
||||||
// Invis damage correction
|
// Invis damage correction, Invis spies get protection from 10% of damage
|
||||||
if (IsPlayerInvisible(target)) {
|
if (IsPlayerInvisible(target)) {
|
||||||
// Invis spies get protection from 10% of damage
|
|
||||||
bdmg = (bdmg * .80) - 1;
|
bdmg = (bdmg * .80) - 1;
|
||||||
cdmg = (cdmg * .80) - 1;
|
cdmg = (cdmg * .80) - 1;
|
||||||
}
|
}
|
||||||
@ -720,7 +653,7 @@ int BestHitbox(CachedEntity* target) {
|
|||||||
} else IF_GAME (IsCSS()) {
|
} else IF_GAME (IsCSS()) {
|
||||||
headonly = true;
|
headonly = true;
|
||||||
}
|
}
|
||||||
// If headonly is true, return the var here
|
// Head only
|
||||||
if (headonly) {
|
if (headonly) {
|
||||||
IF_GAME (IsTF())
|
IF_GAME (IsTF())
|
||||||
return hitbox_t::head;
|
return hitbox_t::head;
|
||||||
@ -734,16 +667,14 @@ int BestHitbox(CachedEntity* target) {
|
|||||||
if (target->hitboxes.VisibilityCheck(i)) return i;
|
if (target->hitboxes.VisibilityCheck(i)) return i;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case 1: { // AUTO-CLOSEST priority
|
case 1: { // AUTO-CLOSEST priority, Return closest hitbox to crosshair
|
||||||
// Return closest hitbox to crosshair
|
|
||||||
return ClosestHitbox(target);
|
return ClosestHitbox(target);
|
||||||
} break;
|
} break;
|
||||||
case 2: { // STATIC priority
|
case 2: { // STATIC priority, Return a user chosen hitbox
|
||||||
// Return a user chosen hitbox
|
|
||||||
return (int)hitbox;
|
return (int)hitbox;
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
// without a good hitbox, just return -1 in its place
|
// Hitbox machine :b:roke
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -769,189 +700,104 @@ int ClosestHitbox(CachedEntity* target) {
|
|||||||
bool VischeckPredictedEntity(CachedEntity* entity) {
|
bool VischeckPredictedEntity(CachedEntity* entity) {
|
||||||
// Retrieve predicted data
|
// Retrieve predicted data
|
||||||
AimbotCalculatedData_s& cd = calculated_data_array[entity->m_IDX];
|
AimbotCalculatedData_s& cd = calculated_data_array[entity->m_IDX];
|
||||||
// If vis check data is up-to-date with tick count then return it
|
|
||||||
if (cd.vcheck_tick == tickcount) return cd.visible;
|
if (cd.vcheck_tick == tickcount) return cd.visible;
|
||||||
// Reset vis check tick and calculate new vis data
|
|
||||||
|
// Update info
|
||||||
cd.vcheck_tick = tickcount;
|
cd.vcheck_tick = tickcount;
|
||||||
cd.visible = IsEntityVectorVisible(entity, PredictEntity(entity));
|
cd.visible = IsEntityVectorVisible(entity, PredictEntity(entity));
|
||||||
// Return found check
|
|
||||||
return cd.visible;
|
return cd.visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// A helper function to find a user angle that isnt directly on the target angle, effectively slowing the aiming process
|
// A helper function to find a user angle that isnt directly on the target angle, effectively slowing the aiming process
|
||||||
void slowAim(Vector &inputAngle, Vector userAngle) {
|
void DoSlowAim(Vector &input_angle) {
|
||||||
// Initialize vars for slow aim
|
static float slow_change_dist_p = 0;
|
||||||
int slowfliptype;
|
static float slow_change_dist_y = 0;
|
||||||
int slowdir;
|
|
||||||
float changey = 0;
|
|
||||||
float changex = 0;
|
|
||||||
|
|
||||||
// Determine whether to move the mouse at all for the yaw
|
// Yaw
|
||||||
if (userAngle.y != inputAngle.y) {
|
if (g_pUserCmd->viewangles.y != input_angle.y) {
|
||||||
|
|
||||||
// Fliping The main axis to prevent 360s from happening when the bot trys to cross -180y and 180y
|
// Check if input angle and user angle are on opposing sides of yaw so we can correct for that
|
||||||
slowfliptype = 0;
|
bool slow_opposing = false;
|
||||||
if ( ((inputAngle.y < -90) && (userAngle.y > 90)) && (slowfliptype == 0) ) {
|
if (input_angle.y < -90 && g_pUserCmd->viewangles.y > 90 || input_angle.y > 90 && g_pUserCmd->viewangles.y < -90)
|
||||||
slowfliptype = 1;
|
slow_opposing = true;
|
||||||
inputAngle.y = inputAngle.y - 90;
|
|
||||||
userAngle.y = userAngle.y + 90;
|
// Direction
|
||||||
}
|
bool slow_dir = false;
|
||||||
if ( ((inputAngle.y > 90) && (userAngle.y < -90)) && (slowfliptype == 0) ) {
|
if (slow_opposing) {
|
||||||
slowfliptype = 2;
|
if (input_angle.y > 90 && g_pUserCmd->viewangles.y < -90) slow_dir = true;
|
||||||
inputAngle.y = inputAngle.y + 90;
|
} else
|
||||||
userAngle.y = userAngle.y - 90;
|
if (g_pUserCmd->viewangles.y > input_angle.y) slow_dir = true;
|
||||||
|
|
||||||
|
// Speed, check if opposing. We dont get a new distance due to the opposing sides making the distance spike, so just cheap out and reuse our last one.
|
||||||
|
if (!slow_opposing) slow_change_dist_y = std::abs(g_pUserCmd->viewangles.y - input_angle.y) / (int)slow_aim;
|
||||||
|
|
||||||
|
// Move in the direction of the input angle
|
||||||
|
if (slow_dir) input_angle.y = g_pUserCmd->viewangles.y - slow_change_dist_y;
|
||||||
|
else input_angle.y = g_pUserCmd->viewangles.y + slow_change_dist_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Math to calculate how much to move the mouse
|
// Pitch
|
||||||
changey = (std::abs(userAngle.y - inputAngle.y)) / ((int)slowaim_smoothing) ;
|
if (g_pUserCmd->viewangles.x != input_angle.x) {
|
||||||
// Use stronger shunting due to the flip
|
// Get speed
|
||||||
if (slowfliptype != 0) changey = ((( std::abs(userAngle.y - inputAngle.y) ) / ((int)slowaim_smoothing * (int)slowaim_smoothing)) / (int)slowaim_smoothing) ;
|
slow_change_dist_p = std::abs(g_pUserCmd->viewangles.x - input_angle.x) / (int)slow_aim;
|
||||||
|
|
||||||
// Determine the direction to move in before reseting the flipped angles
|
// Move in the direction of the input angle
|
||||||
slowdir = 0;
|
if (g_pUserCmd->viewangles.x > input_angle.x) input_angle.x = g_pUserCmd->viewangles.x - slow_change_dist_p;
|
||||||
if ((userAngle.y > inputAngle.y) && (slowdir == 0)) slowdir = 1;
|
else input_angle.x = g_pUserCmd->viewangles.x + slow_change_dist_p;
|
||||||
if ((userAngle.y < inputAngle.y) && (slowdir == 0)) slowdir = 2;
|
|
||||||
|
|
||||||
// Reset Flipped angles and fix directions
|
|
||||||
if (slowfliptype == 1) {
|
|
||||||
inputAngle.y = inputAngle.y + 90;
|
|
||||||
userAngle.y = userAngle.y - 90;
|
|
||||||
slowdir = 2;
|
|
||||||
}
|
|
||||||
if (slowfliptype == 2) {
|
|
||||||
inputAngle.y = inputAngle.y - 90;
|
|
||||||
userAngle.y = userAngle.y + 90;
|
|
||||||
slowdir = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move in the direction determined before the fliped angles
|
// 0.17 is a good amount in general
|
||||||
if (slowdir == 1) inputAngle.y = userAngle.y - changey;
|
slow_can_shoot = false;
|
||||||
if (slowdir == 2) inputAngle.y = userAngle.y + changey;
|
if (slow_change_dist_y < 0.17 && slow_change_dist_p < 0.17) slow_can_shoot = true;
|
||||||
}
|
|
||||||
|
|
||||||
// Determine whether to move the mouse at all for the pitch
|
// Clamp as we changed angles
|
||||||
if (userAngle.x != inputAngle.x) {
|
fClampAngle(input_angle);
|
||||||
changex = (std::abs(userAngle.x - inputAngle.x)) / ((int)slowaim_smoothing) ;
|
|
||||||
|
|
||||||
// Determine the direction to move in
|
|
||||||
if (userAngle.x > inputAngle.x) inputAngle.x = userAngle.x - changex;
|
|
||||||
if (userAngle.x < inputAngle.x) inputAngle.x = userAngle.x + changex;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if can autoshoot with slowaim
|
|
||||||
slowCanShoot = false;
|
|
||||||
if (changey < (0.02*(int)slowaim_autoshoot) && changex < (0.02*(int)slowaim_autoshoot)) slowCanShoot = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// A function that determins whether aimkey allows aiming
|
// A function that determins whether aimkey allows aiming
|
||||||
bool UpdateAimkey() {
|
bool UpdateAimkey() {
|
||||||
static bool aimkey_flip = false;
|
static bool aimkey_flip = false;
|
||||||
static bool pressed_last_tick = false;
|
static bool pressed_last_tick = false;
|
||||||
bool key_down;
|
bool allow_aimkey = true;
|
||||||
bool allowAimkey = true;
|
|
||||||
// Check if aimkey is used
|
// Check if aimkey is used
|
||||||
if (aimkey && aimkey_mode) {
|
if (aimkey && aimkey_mode) {
|
||||||
// Grab whether the aimkey is depressed
|
// Grab whether the aimkey is depressed
|
||||||
key_down = g_IInputSystem->IsButtonDown((ButtonCode_t)(int)aimkey);
|
bool key_down = g_IInputSystem->IsButtonDown((ButtonCode_t)(int)aimkey);
|
||||||
// Switch based on the user set aimkey mode
|
|
||||||
switch ((int)aimkey_mode) {
|
switch ((int)aimkey_mode) {
|
||||||
// Only while key is depressed, enable
|
case 1: // Only while key is depressed
|
||||||
case 1:
|
if (!key_down)
|
||||||
if (!key_down) {
|
allow_aimkey = false;
|
||||||
allowAimkey = false;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
// Only while key is not depressed, enable
|
case 2: // Only while key is not depressed, enable
|
||||||
case 2:
|
if (key_down)
|
||||||
if (key_down) {
|
allow_aimkey = false;
|
||||||
allowAimkey = false;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
// Aimkey acts like a toggle switch
|
case 3: // Aimkey acts like a toggle switch
|
||||||
case 3:
|
|
||||||
if (!pressed_last_tick && key_down) aimkey_flip = !aimkey_flip;
|
if (!pressed_last_tick && key_down) aimkey_flip = !aimkey_flip;
|
||||||
if (!aimkey_flip) {
|
if (!aimkey_flip)
|
||||||
allowAimkey = false;
|
allow_aimkey = false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
pressed_last_tick = key_down;
|
pressed_last_tick = key_down;
|
||||||
}
|
}
|
||||||
// Return whether the aimkey allows aiming
|
// Return whether the aimkey allows aiming
|
||||||
return allowAimkey;
|
return allow_aimkey;
|
||||||
}
|
|
||||||
|
|
||||||
// A function called at 2 points in the create move function
|
|
||||||
// First time is when the aimbot Determines if it should aim and autoshoot
|
|
||||||
// Second time is for when the aimbot determines only when it should aim and always autoshoots
|
|
||||||
// Using either mode has problems with some weapons so we compramise by using a combo of the 2
|
|
||||||
// The point of using this function for 2 uses is to not make duplicate funcs for essentialy the same thing
|
|
||||||
bool GetCanAim(int mode) {
|
|
||||||
|
|
||||||
// User setting check
|
|
||||||
switch (mode) {
|
|
||||||
case 1: // The first check when the aimbot checks if it can aim or shoot
|
|
||||||
|
|
||||||
// If user settings dont allow, Always aim at the point this is called
|
|
||||||
if (!only_can_shoot) return true;
|
|
||||||
// Always aim with melee weapons
|
|
||||||
if (GetWeaponMode() == weaponmode::weapon_melee) return true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2: // Second check when the aimbot checks if it can aim, and will shoot regardless of the output here
|
|
||||||
|
|
||||||
// dont check if should aim with melee weapons
|
|
||||||
if (GetWeaponMode() == weaponmode::weapon_melee) return false;
|
|
||||||
|
|
||||||
// At the point this is called, we dont want to check for can shoot if user settings dont allow
|
|
||||||
if (!only_can_shoot) return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Weapons that should attack continuously
|
|
||||||
bool using_wep_on_list =
|
|
||||||
g_pLocalPlayer->weapon()->m_iClassID == CL_CLASS(CTFPistol_Scout) ||
|
|
||||||
g_pLocalPlayer->weapon()->m_iClassID == CL_CLASS(CTFMinigun) ||
|
|
||||||
g_pLocalPlayer->weapon()->m_iClassID == CL_CLASS(CTFSyringeGun) ||
|
|
||||||
g_pLocalPlayer->weapon()->m_iClassID == CL_CLASS(CTFSMG) ||
|
|
||||||
g_pLocalPlayer->weapon()->m_iClassID == CL_CLASS(CTFRevolver) ||
|
|
||||||
g_pLocalPlayer->weapon()->m_iClassID == CL_CLASS(CTFFlameThrower);
|
|
||||||
|
|
||||||
switch (mode) {
|
|
||||||
case 1: // The first check when the aimbot checks if it can aim or shoot
|
|
||||||
|
|
||||||
// If the player isnt using these weaps, then check for can shoot. If the weapon isnt on the list, then we need to check if the player should aim here and return the result
|
|
||||||
if (!using_wep_on_list) return CanShoot();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2: // Second check when the aimbot checks if it can aim, and will shoot regardless of the output here
|
|
||||||
|
|
||||||
// Return whether we are using one of the weapons on the list because we want to tell the aimbot that we should check for canshoot
|
|
||||||
return using_wep_on_list;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mode wasnt input correctly, just return true and hope for the best
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Func to find value of how far to target ents
|
// Func to find value of how far to target ents
|
||||||
float EffectiveTargetingRange() {
|
float EffectiveTargetingRange() {
|
||||||
// Melees use a close range, TODO add dynamic range for demoknight swords
|
if (GetWeaponMode() == weapon_melee) return 100.0f; // Melees use a close range, TODO add dynamic range for demoknight swords
|
||||||
if (GetWeaponMode() == weapon_melee) {
|
if (g_pLocalPlayer->weapon()->m_iClassID == CL_CLASS(CTFFlameThrower)) return 185.0f; // Pyros only have so much untill their flames hit
|
||||||
return 100.0f;
|
|
||||||
// Pyros only have so much untill their flames hit
|
|
||||||
} else if (g_pLocalPlayer->weapon()->m_iClassID == CL_CLASS(CTFFlameThrower)) {
|
|
||||||
return 185.0f;
|
|
||||||
}
|
|
||||||
// Else return user settings
|
|
||||||
return (float)max_range;
|
return (float)max_range;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A function used by gui elements to determine the current target
|
// A function used by gui elements to determine the current target
|
||||||
CachedEntity* CurrentTarget() {
|
CachedEntity* CurrentTarget() {
|
||||||
// If a target is found return it
|
|
||||||
if (foundTarget)
|
if (foundTarget)
|
||||||
return ENTITY(target_eid);
|
return target; // Doesnt work for some reason
|
||||||
// Else return a nullpointer
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -962,16 +808,12 @@ void Reset() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_VISUALS == 1
|
#if ENABLE_VISUALS == 1
|
||||||
|
|
||||||
// Function called when we need to draw to screen
|
|
||||||
static CatVar fov_draw(CV_SWITCH, "aimbot_fov_draw", "0", "Draw Fov Ring", "Draws a ring to represent your current aimbot fov");
|
static CatVar fov_draw(CV_SWITCH, "aimbot_fov_draw", "0", "Draw Fov Ring", "Draws a ring to represent your current aimbot fov");
|
||||||
void DrawText() {
|
void DrawText() {
|
||||||
// Dont draw to screen when aimbot is disabled
|
// Dont draw to screen when aimbot is disabled
|
||||||
if (!enabled) return;
|
if (!enabled) return;
|
||||||
|
|
||||||
// Fov ring to represent when a target will be shot
|
// Fov ring to represent when a target will be shot
|
||||||
// Not perfect but does a good job of representing where its supposed to be
|
|
||||||
// Broken from kathook merge, TODO needs to be adapted for imgui
|
|
||||||
if (fov_draw) {
|
if (fov_draw) {
|
||||||
// It cant use fovs greater than 180, so we check for that
|
// It cant use fovs greater than 180, so we check for that
|
||||||
if (float(fov) > 0.0f && float(fov) < 180) {
|
if (float(fov) > 0.0f && float(fov) < 180) {
|
||||||
@ -980,17 +822,15 @@ void DrawText() {
|
|||||||
rgba_t color = GUIColor();
|
rgba_t color = GUIColor();
|
||||||
color.a = float(fovcircle_opacity);
|
color.a = float(fovcircle_opacity);
|
||||||
|
|
||||||
// Grab the screen resolution and save to some vars
|
|
||||||
int width, height;
|
int width, height;
|
||||||
g_IEngine->GetScreenSize(width, height);
|
g_IEngine->GetScreenSize(width, height);
|
||||||
|
|
||||||
// Some math to find radius of the fov circle
|
// Math
|
||||||
float mon_fov = (float(width) / float(height) / (4.0f / 3.0f));
|
float mon_fov = (float(width) / float(height) / (4.0f / 3.0f));
|
||||||
float fov_real = RAD2DEG(2 * atanf(mon_fov * tanf(DEG2RAD(draw::fov / 2))));
|
float fov_real = RAD2DEG(2 * atanf(mon_fov * tanf(DEG2RAD(draw::fov / 2))));
|
||||||
|
|
||||||
float radius = tan(DEG2RAD(float(fov)) / 2) / tan(DEG2RAD(fov_real) / 2) * (width);
|
float radius = tan(DEG2RAD(float(fov)) / 2) / tan(DEG2RAD(fov_real) / 2) * (width);
|
||||||
|
|
||||||
// Draw a circle with our newfound circle
|
// Draw a circle
|
||||||
float px = 0;
|
float px = 0;
|
||||||
float py = 0;
|
float py = 0;
|
||||||
constexpr float steps = 120;
|
constexpr float steps = 120;
|
||||||
@ -1010,7 +850,7 @@ void DrawText() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Dont run the following unless debug is enabled
|
// Debug stuff
|
||||||
if (!aimbot_debug) return;
|
if (!aimbot_debug) return;
|
||||||
for (int i = 1; i < 32; i++) {
|
for (int i = 1; i < 32; i++) {
|
||||||
CachedEntity* ent = ENTITY(i);
|
CachedEntity* ent = ENTITY(i);
|
||||||
@ -1024,7 +864,6 @@ void DrawText() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}}}
|
}}}
|
||||||
|
@ -50,12 +50,11 @@ bool ShouldAim();
|
|||||||
CachedEntity* RetrieveBestTarget(bool aimkey_state);
|
CachedEntity* RetrieveBestTarget(bool aimkey_state);
|
||||||
bool IsTargetStateGood(CachedEntity* entity);
|
bool IsTargetStateGood(CachedEntity* entity);
|
||||||
void Aim(CachedEntity* entity);
|
void Aim(CachedEntity* entity);
|
||||||
bool CanAutoShoot();
|
void DoAutoshoot();
|
||||||
int BestHitbox(CachedEntity* target);
|
int BestHitbox(CachedEntity* target);
|
||||||
int ClosestHitbox(CachedEntity* target);
|
int ClosestHitbox(CachedEntity* target);
|
||||||
void slowAim(Vector &inputAngle, Vector userAngle);
|
void DoSlowAim(Vector &inputAngle);
|
||||||
bool UpdateAimkey();
|
bool UpdateAimkey();
|
||||||
bool GetCanAim(int mode);
|
|
||||||
float EffectiveTargetingRange();
|
float EffectiveTargetingRange();
|
||||||
|
|
||||||
}}}
|
}}}
|
||||||
|
@ -325,7 +325,7 @@ void CreateMove() {
|
|||||||
g_IEngine->GetViewAngles(cameraAngle);
|
g_IEngine->GetViewAngles(cameraAngle);
|
||||||
|
|
||||||
// Set userAngle = camera angles
|
// Set userAngle = camera angles
|
||||||
g_pUserCmd->viewangles.y = cameraAngle[1];
|
//g_pUserCmd->viewangles.y = cameraAngle[1];
|
||||||
g_pLocalPlayer->v_OrigViewangles.y = cameraAngle[1];
|
g_pLocalPlayer->v_OrigViewangles.y = cameraAngle[1];
|
||||||
|
|
||||||
// Use silent since we dont want to prevent the player from looking around
|
// Use silent since we dont want to prevent the player from looking around
|
||||||
@ -420,6 +420,7 @@ void DrawText() {
|
|||||||
AddSideString(format("Velocity2: ", vel.Length2D()));
|
AddSideString(format("Velocity2: ", vel.Length2D()));
|
||||||
AddSideString(format("flSimTime: ", LOCAL_E->var<float>(netvar.m_flSimulationTime)));
|
AddSideString(format("flSimTime: ", LOCAL_E->var<float>(netvar.m_flSimulationTime)));
|
||||||
if (g_pUserCmd) AddSideString(format("command_number: ", last_cmd_number));
|
if (g_pUserCmd) AddSideString(format("command_number: ", last_cmd_number));
|
||||||
|
AddSideString(format("clip: ", CE_INT(g_pLocalPlayer->weapon(), netvar.m_iClip1)));
|
||||||
/*AddSideString(colors::white, "Weapon: %s [%i]", RAW_ENT(g_pLocalPlayer->weapon())->GetClientClass()->GetName(), g_pLocalPlayer->weapon()->m_iClassID);
|
/*AddSideString(colors::white, "Weapon: %s [%i]", RAW_ENT(g_pLocalPlayer->weapon())->GetClientClass()->GetName(), g_pLocalPlayer->weapon()->m_iClassID);
|
||||||
//AddSideString(colors::white, "flNextPrimaryAttack: %f", CE_FLOAT(g_pLocalPlayer->weapon(), netvar.flNextPrimaryAttack));
|
//AddSideString(colors::white, "flNextPrimaryAttack: %f", CE_FLOAT(g_pLocalPlayer->weapon(), netvar.flNextPrimaryAttack));
|
||||||
//AddSideString(colors::white, "nTickBase: %f", (float)(CE_INT(g_pLocalPlayer->entity, netvar.nTickBase)) * gvars->interval_per_tick);
|
//AddSideString(colors::white, "nTickBase: %f", (float)(CE_INT(g_pLocalPlayer->entity, netvar.nTickBase)) * gvars->interval_per_tick);
|
||||||
|
@ -695,6 +695,7 @@ bool CanHeadshot() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool CanShoot() {
|
bool CanShoot() {
|
||||||
|
|
||||||
float servertime, nextattack;
|
float servertime, nextattack;
|
||||||
|
|
||||||
servertime = (float)(CE_INT(g_pLocalPlayer->entity, netvar.nTickBase)) * g_GlobalVars->interval_per_tick;
|
servertime = (float)(CE_INT(g_pLocalPlayer->entity, netvar.nTickBase)) * g_GlobalVars->interval_per_tick;
|
||||||
|
Reference in New Issue
Block a user