Welcome, Guest.

Author Topic: [Coding] Internal C++ Aimbot Snaps to a Random Location Then Hangs The Game  (Read 973 times)

Offline asdqwe1548

  • Posts: 11
    • View Profile
Hey UC, been having some issues with this aimbot lately. Title explains the problem. I load into a local game, spawn some bots, activate aimbot, aim snaps to a random spot then hangs the game.

Aim code:
Code:
Code: [Select]
void CAim::Aimbot(CUserCmd* cmd, C_BaseEntity* localPlayer)
{
QAngle aimAngle;
Vector playerHeadPos;
 
if (GetAsyncKeyState(70))
{
DropTarget();
 
for (int i = 0; i < entitylist->NumberOfEntities(false); i++)
{
C_BaseEntity *pPlayer = (C_BaseEntity*)entitylist->GetClientEntity(i);
 
if (pPlayer && pPlayer != localPlayer && !pPlayer->IsDormant() && pPlayer->GetHealth() > 0)
{
pDrawing.GetBonePosition(pPlayer, playerHeadPos, 6);
 
aimAngle = math.CalcAngle2(localPlayer->GetEyePos(), playerHeadPos);
 
m_target = i;
}
}
 
if (m_target != -1)
{
g_pEngine->SetViewAngles(aimAngle);
}
}
}
Math code:
Code:
void CMath::NormalizeVector2(Vector& in)
{
if (in.x > 89)in.x = 89;
if (in.x < -89)in.x = -89;
while (in.y > 180)in.y -= 360;
while (in.y < -180)in.y += 360;
in.z = 0;
}
 
void CMath::VectorAngles2(const Vector& forward, QAngle& angles)
{
if (forward[1] == 0.0f && forward[0] == 0.0f)
{
angles[0] = (forward[2] > 0.0f) ? 270.0f : 90.0f; // Pitch (up/down)
angles[1] = 0.0f; //yaw left/right
}
else
{
angles[0] = atan2(-forward[2], forward.Length2D()) * -180 / M_PI;
angles[1] = atan2(forward[1], forward[0]) * 180 / M_PI;
 
if (angles[1] > 90)
angles[1] -= 180;
else if (angles[1] < 90)
angles[1] += 180;
else if (angles[1] == 90)
angles[1] = 0;
}
 
angles[2] = 0.0f;
}
 
QAngle CMath::CalcAngle2(Vector src, Vector dst)
{
QAngle angles;
Vector delta = src - dst;
VectorAngles2( delta, angles );
NormalizeVector2(delta);
return angles;
}
Bone code:
Code:
bool CDrawing::GetBonePosition(C_BaseEntity* pPlayer, Vector& Hitbox, int Bone)
{
matrix3x4_t matrix[128];
if (!pPlayer->SetupBones(matrix, 128, BONE_USED_BY_HITBOX, g_pEngine->GetLastTimeStamp()))
return false;
Hitbox = Vector(matrix[Bone][0][3], matrix[Bone][1][3], matrix[Bone][2][3]);
return true;
}
The math functions are taken from tgf, since I thought mine might've been the problem, was wrong.
« Last Edit: September 09, 2018, 11:09:25 AM by KittoniuM »

Offline jktheboss

  • Posts: 10
    • View Profile
Re: [Coding] Internal C++ Aimbot Snaps to a Random Location Then Hangs The Game
« Reply #1 on: September 09, 2018, 08:32:03 AM »
Looks like chinese for me, C++ is too difficult  :-\


Total Registered Members:





2017-2023 BigPackets. All rights reserved. All other trademarks, logos and copyrights are the property of their respective owners. This site is not associated with any company in any way.