Proj ESP
This commit is contained in:
parent
a43983ee5c
commit
cf216c5386
@ -59,6 +59,8 @@ void EntityVariables::Init() {
|
||||
this->nForceTauntCam = gNetvars.get_offset("DT_TFPlayer", "m_nForceTauntCam");
|
||||
this->iFOV = gNetvars.get_offset("DT_BasePlayer", "m_iFOV");
|
||||
this->iDefaultFOV = gNetvars.get_offset("DT_BasePlayer", "m_iDefaultFOV");
|
||||
this->Rocket_bCritical = gNetvars.get_offset("DT_TFBaseRocket", "m_bCritical");
|
||||
this->Grenade_bCritical = gNetvars.get_offset("DT_TFWeaponBaseGrenadeProj", "m_bCritical");
|
||||
}
|
||||
|
||||
void InitEntityOffsets() {
|
||||
|
@ -82,6 +82,8 @@ public:
|
||||
|
||||
offset_t Rocket_iDeflected;
|
||||
offset_t Grenade_iDeflected;
|
||||
offset_t Rocket_bCritical;
|
||||
offset_t Grenade_bCritical;
|
||||
|
||||
offset_t bDistributed;
|
||||
|
||||
|
@ -45,6 +45,13 @@ void CachedEntity::Update(int idx) {
|
||||
m_flDistance = (g_pLocalPlayer->entity->GetAbsOrigin().DistTo(m_pEntity->GetAbsOrigin()));
|
||||
}
|
||||
m_bAlivePlayer = false;
|
||||
if (IsProjectile(m_pEntity)) {
|
||||
m_bCritProjectile = IsProjectileCrit(m_pEntity);
|
||||
m_bIsVisible = IsEntityVisible(m_pEntity, -1);
|
||||
m_iTeam = Var<int>(netvar.iTeamNum);
|
||||
m_bEnemy = (m_iTeam != g_pLocalPlayer->team);
|
||||
}
|
||||
|
||||
if (m_iClassID == ClassID::CTFPlayer) {
|
||||
m_bAlivePlayer = !(m_bNULL || m_bDormant || GetEntityValue<char>(m_pEntity, netvar.iLifeState));
|
||||
m_iTeam = Var<int>(netvar.iTeamNum); // TODO
|
||||
|
@ -35,6 +35,8 @@ public:
|
||||
int m_iClassID;
|
||||
float m_flDistance;
|
||||
|
||||
bool m_bCritProjectile;
|
||||
|
||||
int m_iTeam;
|
||||
bool m_bAlivePlayer;
|
||||
bool m_bEnemy;
|
||||
|
@ -33,13 +33,13 @@ bool AutoReflect::ShouldReflect(IClientEntity* ent) {
|
||||
case ClassID::CTFProjectile_Cleaver:
|
||||
case ClassID::CTFProjectile_Jar:
|
||||
case ClassID::CTFProjectile_JarMilk: {
|
||||
int deflected = GetEntityValue<int>(ent, netvar.Rocket_iDeflected);
|
||||
int deflected = GetEntityValue<int>(ent, netvar.Grenade_iDeflected);
|
||||
if (deflected) return false;
|
||||
if (GetEntityValue<int>(ent, netvar.iTeamNum) == g_pLocalPlayer->team) return false;
|
||||
return true;
|
||||
} break;
|
||||
case ClassID::CTFGrenadePipebombProjectile: {
|
||||
int deflected = GetEntityValue<int>(ent, netvar.Rocket_iDeflected);
|
||||
int deflected = GetEntityValue<int>(ent, netvar.Grenade_iDeflected);
|
||||
if (deflected) return false;
|
||||
if (GetEntityValue<int>(ent, netvar.iTeamNum) == g_pLocalPlayer->team) return false;
|
||||
if (GetEntityValue<int>(ent, netvar.iPipeType) == 1) {
|
||||
|
@ -57,6 +57,12 @@ ESP::ESP() {
|
||||
v_bShowHealthNumbers = CreateConVar(CON_PREFIX "esp_health_num", "1", "Health in numbers");
|
||||
v_bShowMoney = CreateConVar(CON_PREFIX "esp_money", "1", "MvM money");
|
||||
v_bShowRedMoney = CreateConVar(CON_PREFIX "esp_money_red", "1", "Red MvM money");
|
||||
this->v_iShowRockets = CreateConVar(CON_PREFIX "esp_proj_rockets", "1", "Rockets");
|
||||
this->v_iShowArrows = CreateConVar(CON_PREFIX "esp_proj_arrows", "1", "Arrows");
|
||||
this->v_iShowStickies = CreateConVar(CON_PREFIX "esp_proj_stickies", "1", "Stickies");
|
||||
this->v_iShowPipes = CreateConVar(CON_PREFIX "esp_proj_pipes", "1", "Pipes");
|
||||
this->v_bOnlyEnemyProjectiles = CreateConVar(CON_PREFIX "esp_proj_enemy", "Only enemy projectiles", "0");
|
||||
this->v_bProjectileESP = CreateConVar(CON_PREFIX "esp_proj", "1", "Projectile ESP");
|
||||
}
|
||||
|
||||
#define ESP_HEIGHT 14
|
||||
@ -154,6 +160,48 @@ void ESP::ProcessEntity(CachedEntity* ent) {
|
||||
}
|
||||
|
||||
switch (ent->m_iClassID) {
|
||||
case ClassID::CTFProjectile_Rocket:
|
||||
case ClassID::CTFProjectile_SentryRocket: {
|
||||
if (!v_bProjectileESP->GetBool() || !v_iShowRockets->GetBool()) break;
|
||||
if (v_iShowRockets->GetInt() == 2 && !ent->m_bCritProjectile) break;
|
||||
if (!ent->m_bEnemy) {
|
||||
if (!v_bTeammates->GetBool() || v_bOnlyEnemyProjectiles->GetBool()) break;
|
||||
}
|
||||
ent->AddESPString(color, bgclr, "[ ==> ]");
|
||||
if (this->v_bShowDistance) {
|
||||
ent->AddESPString(color, bgclr, "%im", (int)(ent->m_flDistance / 64 * 1.22f));
|
||||
}
|
||||
} break;
|
||||
case ClassID::CTFGrenadePipebombProjectile: {
|
||||
if (!v_bProjectileESP->GetBool()) break;
|
||||
if (!ent->m_bEnemy) {
|
||||
if (!v_bTeammates->GetBool() || v_bOnlyEnemyProjectiles->GetBool()) break;
|
||||
}
|
||||
switch (ent->Var<int>(netvar.iPipeType)) {
|
||||
case 0:
|
||||
if (!v_iShowPipes->GetBool()) break;
|
||||
if (v_iShowPipes->GetInt() == 2 && !ent->m_bCritProjectile) break;
|
||||
ent->AddESPString(color, bgclr, "[ (PP) ]");
|
||||
case 1:
|
||||
if (!v_iShowStickies->GetBool()) break;
|
||||
if (v_iShowStickies->GetInt() == 2 && !ent->m_bCritProjectile) break;
|
||||
ent->AddESPString(color, bgclr, "[ {*} ]");
|
||||
}
|
||||
if (this->v_bShowDistance) {
|
||||
ent->AddESPString(color, bgclr, "%im", (int)(ent->m_flDistance / 64 * 1.22f));
|
||||
}
|
||||
} break;
|
||||
case ClassID::CTFProjectile_Arrow: {
|
||||
if (!v_bProjectileESP->GetBool() || !v_iShowArrows->GetBool()) break;
|
||||
if (v_iShowArrows->GetInt() == 2 && !ent->m_bCritProjectile) break;
|
||||
if (!ent->m_bEnemy) {
|
||||
if (!v_bTeammates->GetBool() || v_bOnlyEnemyProjectiles->GetBool()) break;
|
||||
}
|
||||
ent->AddESPString(color, bgclr, "[ >>---> ]");
|
||||
if (this->v_bShowDistance) {
|
||||
ent->AddESPString(color, bgclr, "%im", (int)(ent->m_flDistance / 64 * 1.22f));
|
||||
}
|
||||
} break;
|
||||
case ClassID::CTFTankBoss: {
|
||||
if (!this->v_bShowTank->GetBool()) break;
|
||||
ent->AddESPString(color, bgclr, "Tank");
|
||||
|
@ -44,6 +44,15 @@ public:
|
||||
ConVar* v_bLegit;
|
||||
ConVar* v_bShowHealthNumbers;
|
||||
ConVar* v_iLegitSeenTicks;
|
||||
|
||||
ConVar* v_iShowRockets;
|
||||
ConVar* v_iShowArrows;
|
||||
ConVar* v_iShowPipes;
|
||||
ConVar* v_iShowStickies;
|
||||
|
||||
ConVar* v_bOnlyEnemyProjectiles;
|
||||
ConVar* v_bProjectileESP;
|
||||
|
||||
//ConVar* v_bModelInfo;
|
||||
};
|
||||
|
||||
|
@ -315,10 +315,14 @@ bool IsEntityVisible(IClientEntity* entity, int hb) {
|
||||
IClientEntity* local = interfaces::entityList->GetClientEntity(interfaces::engineClient->GetLocalPlayer());
|
||||
trace_filter->SetSelf(local);
|
||||
Vector hit;
|
||||
int ret = GetHitboxPosition(entity, hb, hit);
|
||||
if (ret) {
|
||||
//logging::Info("Couldn't get hitbox position: %i", hb);
|
||||
return false;
|
||||
if (hb == -1) {
|
||||
hit = entity->GetAbsOrigin();
|
||||
} else {
|
||||
int ret = GetHitboxPosition(entity, hb, hit);
|
||||
if (ret) {
|
||||
//logging::Info("Couldn't get hitbox position: %i", hb);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
ray.Init(local->GetAbsOrigin() + GetEntityValue<Vector>(local, netvar.vViewOffset), hit);
|
||||
interfaces::trace->TraceRay(ray, 0x4200400B, trace_filter, &trace_visible);
|
||||
@ -438,6 +442,43 @@ bool IsMeleeWeapon(IClientEntity* ent) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsProjectile(IClientEntity* ent) {
|
||||
if (!ent) return false;
|
||||
switch (ent->GetClientClass()->m_ClassID) {
|
||||
case ClassID::CTFProjectile_Arrow:
|
||||
case ClassID::CTFProjectile_Flare:
|
||||
case ClassID::CTFProjectile_HealingBolt:
|
||||
case ClassID::CTFProjectile_Rocket:
|
||||
case ClassID::CTFProjectile_SentryRocket:
|
||||
case ClassID::CTFProjectile_EnergyBall:
|
||||
case ClassID::CTFProjectile_Cleaver:
|
||||
case ClassID::CTFProjectile_Jar:
|
||||
case ClassID::CTFProjectile_JarMilk:
|
||||
case ClassID::CTFGrenadePipebombProjectile:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsProjectileCrit(IClientEntity* ent) {
|
||||
if (!ent) return false;
|
||||
switch (ent->GetClientClass()->m_ClassID) {
|
||||
case ClassID::CTFProjectile_Arrow:
|
||||
case ClassID::CTFProjectile_Flare:
|
||||
case ClassID::CTFProjectile_HealingBolt:
|
||||
case ClassID::CTFProjectile_Rocket:
|
||||
case ClassID::CTFProjectile_SentryRocket:
|
||||
case ClassID::CTFProjectile_EnergyBall:
|
||||
return GetEntityValue<int>(ent, netvar.Rocket_bCritical);
|
||||
case ClassID::CTFProjectile_Cleaver:
|
||||
case ClassID::CTFProjectile_Jar:
|
||||
case ClassID::CTFProjectile_JarMilk:
|
||||
case ClassID::CTFGrenadePipebombProjectile:
|
||||
return GetEntityValue<int>(ent, netvar.Grenade_bCritical);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
weaponmode GetWeaponMode(IClientEntity* player) {
|
||||
if (!player) return weapon_invalid;
|
||||
int weapon_handle = GetEntityValue<int>(player, netvar.hActiveWeapon);
|
||||
|
@ -73,6 +73,8 @@ void AimAt(Vector origin, Vector target, CUserCmd* cmd);
|
||||
void AimAtHitbox(IClientEntity* ent, int hitbox, CUserCmd* cmd);
|
||||
|
||||
bool IsMeleeWeapon(IClientEntity* ent);
|
||||
bool IsProjectile(IClientEntity* ent);
|
||||
bool IsProjectileCrit(IClientEntity* ent);
|
||||
|
||||
QAngle VectorToQAngle(Vector in);
|
||||
Vector QAngleToVector(QAngle in);
|
||||
|
Reference in New Issue
Block a user