Vehicle Aimbot (Jet,Heli)Source Code
Code:
//add this to your vec3 class. or to your physiycs class if you have one. or rewrite it and just add it to your hack
//you will need a dotproduct function
float Vec3::AimFloat(Vec3 &delta, const float &FOV) const
{
return asinf(this->dot(delta)) / FOV;
}
Code:
//some pointers
Vec3 Origin = GameRenderer->Singleton()->m_viewParams.firstPersonTransform.trans;
Vec3 Left = GameRenderer->Singleton()->m_viewParams.firstPersonTransform.left;
Vec3 Up = GameRenderer->Singleton()->m_viewParams.firstPersonTransform.up;
Code:
//the function itself
BOOL Rotation() // Fragger aka dudeinberlin
{
float flYaw ,flPitch,flRoll;
//TargetArray is the final target vector, this will differ for your hack. i store my targetvecs in an array, hence i can call this rotation function without any params.
Vec3 dt = TargetArray() - Origin;
//don't forget to norm the delta for the coming calculations
dt.normalize();
if(MyPlayer->isInVehicle())
{
flYaw = Left.AimFloat(dt,GameRenderer->Singleton()->m_viewParams.view.m_fovX / 2.0f);
flPitch = Up.AimFloat(dt,GameRenderer->Singleton()->m_viewParams.view.m_fovX / 2.0f);
flRoll = flYaw;
//ya ya, how to now if your a jet or heli? search the ucforum
//flVehicleSens is dynamic in my hack. best Results with a very low sens of 8.0 or lower
if(bImaJet||bImAHeli)
flInputAction[ConceptPitch] = -flPitch * flVehicleSens;
else
flInputAction[ConceptPitch] = flPitch * flVehicleSens;
flInputAction[ConceptYaw] = flYaw * flVehicleSens;
flInputAction[ConceptRoll] = flRoll* flVehicleSens;
if(bFire)
AutoFireLogic();
return TRUE;
}
else
{
//tada you should know this.
}
return FALSE;
}