Visibility Check for Aimbot
sorry for English
I got an aimbot, but its aiming through walls.
When I hold the button, it locks, through the walls
In disconnected mode with the bot running normally, it does not pass through the wall.
Does anyone know how I fix it?
Code:
for each (Player player in EntiesLists->MaxPlayers)
{
if (player.GetPlayerIndex() == EntiesLists->pLocal.GetPlayerIndex() && EntiesLists->pLocal.IsInGame())
continue;
if (!player.IsAlive())
continue;
if (player.GetDormant())
continue;
if (player.getTeam() == EntiesLists->pLocal.getTeam())
continue;
if (!player.GetSpottedbyMask())
continue;
if (player.SetAntiSpawnProt())
continue;
Vector headPosition = player.GetBonePosition(settings->AimbotBone);
if (headPosition.IsEmpty())
return;
Vector aimAngle;
JustMath::CalcAngle(EntiesLists->pLocal.GetEyePosition(), headPosition, aimAngle);
aimAngle.x -= AimPunch.x;
aimAngle.y -= AimPunch.y;
float Fov = JustMath::GetFov(EntiesLists->pLocal.GetViewAngles(), aimAngle);
if (Fov < CustomFov) {
AimAngle = aimAngle;
CustomFov = Fov;
}
}
EntityBase.cpp
Code:
int EntityBase::getTeam()
{
return Mem->ReadNow<int>(BaseAddres + Offset::TeamNum);
}
int EntityBase::GetPlayerIndex()
{
return Mem->ReadNow<int>(BaseAddres + Offset::Index);
}
Vector EntityBase::GetPlayerPosition()
{
if (CrossPosition.IsEmpty())
CrossPosition = Mem->ReadNow<Vector>(BaseAddres + Offset::VecOrigin);
return CrossPosition;
}
bool EntityBase::GetDormant()
{
return Mem->ReadNow<char>(BaseAddres + Offset::Dormant)==1;
}
bool EntityBase::SetAntiSpawnProt()
{
return Mem->ReadNow<bool>(BaseAddres + Offset::GunGameImmunity);
}
void EntityBase::SetSpotted(bool value)
{
Mem->WriteNow<bool>(BaseAddres + Offset::bSpotted, value);
}
byte EntityBase::GetSpottedbyMask()
{
return Mem->ReadNow<byte>(BaseAddres + Offset::SpottedByMask);
}
use some form of tracing, i see your using GetSpottedbyMask, that will work but is very very slow and has issues when the range is pretty far.