Welcome, Guest.

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

Offline asdqwe1548

  • Level 1 - Noob
  • *
  • Posts: 11
    • View Profile
  • Korea, Republic of
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

  • Level 1 - Noob
  • *
  • Posts: 10
    • View Profile
  • France
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  :-\

Offline KittoniuM

  • Administrator
  • Level 8 - Tru Packet
  • *
  • Posts: 1207
    • View Profile
  • Canada
Re: [Coding] Internal C++ Aimbot Snaps to a Random Location Then Hangs The Game
« Reply #2 on: September 09, 2018, 11:09:50 am »
Hey UC

LOL!!! THIS ISNT UNKNOWNCHEATS, GTFO




Total Members


  • Youtube Youtube
  • Facebook Facebook
  • Twitter Twitter
  • Steam Steam

  • Powered by SMF | SMF © 2018, Simple Machines

    2018 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.