Simple Aimbot PS2

From UnKnoWnCheaTs Game Hacking Wiki
Jump to: navigation, search

By: Absinth


02E50340 -> CGame* game
 CGame+0xE0 -> CController* m_controller
  CController+0x60 -> CObject* m_player // you, if you're not in a vehicle, else NULL
   CObject+0x100 -> Vec4 m_position // maybe not the best option
  CController+0xB0 -> float m_yaw // also if you're not in a vehicle
  CController+0xB4 -> float m_pitch // this also


Angles are in radians Everything is in a normal right handed coordsystem, camera looking into z direction.

So, for the desired yaw and pitch, aiming directly at your enemys ethmoid bone, you'll do this:

void AimAtObject(CGame* game, CObject* aim)
{
	if(!aim || !game || !game->m_controller || !game->m_controller->m_player)
		return;
		
	CObject* you = game->m_controller->m_player;

	Vec4 distance;
	distance.x = aim->m_position.x - you->m_position.x;
	distance.y = aim->m_position.y - you->m_position.y;
	distance.z = aim->m_position.z - you->m_position.z;
	float yaw = atan2f(distance.x, distance.z);
	
	float xzlength = sqrt((distance.x * distance.x) + (distance.z * distance.z));
	float pitch = atan2f(distance.y, xzlength);
	
	game->m_controller->m_yaw = yaw;
	game->m_controller->m_pitch = pitch;
}


Precision is a bit exaggerated, its aiming at cameraheight. So, this lacks some predictions and a heightmod for yours and the enemys player stance.

But that shouldn't be a problem, the cameraheight is a float located at CController+0x94 (Standing: 1.6f, Crouching: 0.95f) And CObject+0x300 & 0x04 is set, when your player is crouching or the enemy.


Source: http://www.unknowncheats.me/forum/planetside-2/84105-simple-aimbot.html