Since theire are already public aimbot hacks i decided to release my AimAtPlayer script
The code is a little bit messy but it works it also draws a line to the target and if you hold right mouse button you will aim at him
And if you are using unreals mini SDK you will need to fix SetCameraAimRotPawn()
Code:
void AimAtPlayer(UCanvas* Canvas, APawn* TargetPawn)
{
if (TargetPawn != NULL && mAPBPawn != NULL){
FName NameHeadBone = TargetPawn->Mesh->GetBoneName(6);
FVector VectorHead = TargetPawn->Mesh->GetBoneLocation(NameHeadBone,0);
FVector2D vHead = CalculateScreenCoordinate(pCanvas,TargetPawn->Mesh->GetBoneLocation(NameHeadBone,0));
pCanvas->Draw2DLine(pCanvas->ClipX/2,pCanvas->ClipY/2,vHead.X,vHead.Y,Red);
VectorHead = VectorHead -MyCameraLocation ;
AimAtRot = VectorHead****tation();
NormalizeRotation(AimAtRot);
FRotator* pAimAtRot = &AimAtRot;
if(GetAsyncKeyState(VK_RBUTTON))
{
mAPBPawn->SetCameraAimRotPawn(pAimAtRot);
}
}
}
since i saw this is my 100st post I will put in some extra for you guys to c&p
this code will get the closest enemy in range of your aim angle define BestAngle before you go through all players i set it on 56 and works pretty well for me
again this code maybe a bit messy but it works
Code:
float CurrentAngle = GetViewAngle( Target->Location, ViewLocation );
if ( CheckAngle( CurrentAngle, pPC->PlayerCamera->GetFOVAngle() ) )
{
if ( ( !TargetPawn
|| RadianToDegree(CurrentAngle) > BestAngle ) && APBPawn->PlayerCanSeeMe() )
{
BestAngle = RadianToDegree(CurrentAngle);
TargetPawn = Target;
}
}
Credits:bwarrior