HelpBone Triggerbot

Posts 1–6 of 6 · Page 1 of 1
Bone Triggerbot
Dear MPGH,

I was wondering if anyone maybe could tell me a way how to make a bone triggerbot, seen as I couldn't find a tutorial/ source code to study before making my own.
/Moved to the correct section.
If you can't find a source code/tutorial... You're not searching hard enough...
There's plently of source to study or pasta some.
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.
I'm external atm, but thanks for the help!
/Solved & closed.
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us