Yes i can tell you.
Let's start?
k.
First, start the loop, check the whole sh*t in triggerbot, as, id, team, life...
So now you tecnically shoot, but you won't, before you do, Calculate the angle that you should aim to be in the desired bone.
Code:
#define M_RADPI 57.295779513082f
auto Delta = pLocal->EyePosition() - pEntity->BonePosition(/*Desired Bone*/);
Vector Aim = { (atanf(Delta.z / Math->Length(Delta)) * M_RADPI), (atanf(Delta.y / Delta.x) * M_RADPI), 0.0f };
if (Delta.x >= 0.0)
Aim.y += 180.0f;
And after that check if that pos is in the FOV,
Code:
if (Math->Fov(pLocal->Position(), pEntity->Position(), Aim, pEngine->ViewAngle()) <= /*Value that fits for you*/)
//shoot?
FOV:
Code:
float CMath::Fov(Vector MyPosition, Vector EntityPosition, Vector AimAngles, Vector CurrentAngles)
{
auto distance = Distance3D(MyPosition, EntityPosition) / 0.01905f;
auto prad = ((CurrentAngles.x - AimAngles.x) * 0.0174533f);
auto yrad = ((CurrentAngles.y - AimAngles.y) * 0.0174533f);
auto pitch = sin(prad) * distance;
auto yaw = sin(yrad) * distance;
return sqrt(powf(pitch, 2.0) + powf(yaw, 2.0));
}
As you don't asked for a Hitbox triggerbot, i used fov to check the area, well i don't know also if you are internal or external, but that's the basic behind, should not be hard.