Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void clampAngles(Vector3& va)
- {
- if (va.y < -180.0f)
- va.y += 360.0f;
- if (va.y > 180.0f)
- va.y -= 360.0f;
- if (va.x < -89.0f)
- va.x = 89.0f;
- if (va.x > 89.0f)
- va.x = 89.0f;
- }
- void setAngles(const Vector3& va)
- {
- ptr_t clientState = csgo.read<ptr_t>(csgo.static.clientState);
- if (!clientState)
- return;
- csgo.write<Vector3>(clientState + csgo.static.viewangles);
- }
- void aimbot_t::aimbot()
- {
- Vector3 dir = m_bestTarget - csgo.cl.player.getEyePosition();
- Vector3 aimangles;
- vectorNormalize(dir);
- vectorAngles(dir, aimangles);
- clampAngles(aimangles);
- setAngles(aimangles);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement