# Video TutorialCSGO Aimbot Tutorial + CalcAngle Explained in Detail

#### BDKPlayer

##### No hack no life
Dank Tier VIP
Dank Tier Donator
@BDKPlayer will teach you how to make a basic aimbot in CSGO. You should already know the basics, this is not a beginner tutorial. This is for people wanting to learn how to make a basic aimbot and wanting to understand the math behind it. It's basic trigonometry, but even basic trigonometry can be confusing.

In order to to write a CalcAngle function or a AimAt function you need to understand the basics of the pythagorean theorem and euclidean geometry. Basics things you want to understand in regards to angles/triangles are sine, cosine & tangent. And their inverses, arcsine, arccosine, and arctangent.

You will learn how we apply these ideas to develope an aimbot.

Before you do this tutorial you will want to be educated on CSGO and the basics of game hacking:
-Guide - How to Make CSGO Hacks - START HERE GUIDE
-Guide - START HERE Beginners Guide to Learning Game Hacking

@Liduen posted a good picture illustrating some of this: https://guidedhacking.com/gh/sshots/ey5oob9p.jpg

Huge thank you @BDKPlayer for making this video!

Download source code in attachments, you just need to update the offsets

#### Attachments

• 13.4 KB Views: 1,708
Last edited by a moderator:

#### Rake

premiering shortly:

Awesome !

#### Icew0lf

##### Software Ninjaneer
Dank Tier VIP
Fleep Tier Donator
@BDKPlayer damn, you did it! Great tutorial <3

BDKPlayer

#### Rake

This video is going to break a record, it had 350 views during the premiere and it's gonna hit 2,500 views within 24 hours. Thanks again @BDKPlayer for this awesome video (hope you make some more )

#### XdarionX

##### Dying Light Hacker
Dank Tier VIP
Dank Tier Donator
that beams are just awesome

I have a question about the vector3 class.
C++:
``````Vector3& operator+(Vector3 arg)
{
x += arg.x;
y += arg.y;
z += arg.z;
return *this;
}``````
what is this function used for?.

Last edited:

#### Rake

I have a question about the vector3 class.
C++:
``````Vector3& operator+(Vector3 arg)
{
x += arg.x;
y += arg.y;
z += arg.z;
return *this;
}``````
what is this function used for?.

vecA = vecA + vecB;

vecA = vecA + vecB;
Yeah, but why would we need to add vectors together?

#### Broihon

##### edgy 12 y/o
Escobar Tier VIP
Fleep Tier Donator
Yeah, but why would we need to add vectors together?
Not in this tutorial but sometimes you need to do that. A class like that should support all arithmetic operators.

#### Kleon742

##### Feature Enthusiast
Moderator
Dank Tier VIP
Dank Tier Donator

Not in this tutorial but sometimes you need to do that. A class like that should support all arithmetic operators.
Ok, I was just confused as I didn't see it being called anywhere.

Mathematics
Yeah I understand it's maths I just didn't see why it needed to be there as it's not being called anywhere

#### Meanjellybean

Trump Tier Donator
Dank Tier Donator
WOW love this detail. im very impressed by this whole site!
this is for the love of the game

#### Laszl0w

Thank you for this tutorial.
Works with bots but when i go to Deathmatch with players sometimes it aim's to nothing and game get's crashed.

#### Broihon

##### edgy 12 y/o
Escobar Tier VIP
Fleep Tier Donator
Thank you for this tutorial.
Works with bots but when i go to Deathmatch with players sometimes it aim's to nothing and game get's crashed.

Laszl0w

#### Laszl0w

Now i got this problem.

When i'm in front of the target it aims perfectly.

When i am behind the enemy it's moving the chrosshair near the enemy head.

Thank you.

#### BDKPlayer

##### No hack no life
Dank Tier VIP
Dank Tier Donator
Now i got this problem.
When i'm in front of the target it aims perfectly.
When i am behind the enemy it's moving the chrosshair near the enemy head.
How do you get the head position? Do you use bones to get the head bone? Or just add origin + viewOffset? If thats not the issue we will have to see some code I guess.

Laszl0w

#### Laszl0w

I didnt use bones

Code:
``````DWORD CurrentBaseAddress = proM.Read<DWORD>(Client + dwLocalPlayer);

Code:
``````    DWORD CurrentBaseAddress = proM.Read<DWORD>(Client + dwEntityList + (i * 0x10));
Code:
``````void changeAngle(float xAngle, float yAngle)
{
proM.Write<float>(val.EngineAdr + dwClientState_ViewAngles + 4, xAngle);
}``````
Code:
``````void AimtoNearest(int i)
{

Vector3 deltaVec1 = Vector3( entity[i].x - player.x, entity[i].y - player.y, entity[i].z - player.z );
float deltaVecLength1 = sqrt(deltaVec1.x * deltaVec1.x + deltaVec1.y * deltaVec1.y + deltaVec1.z * deltaVec1.z);
double PI = 3.14159265358;
float pitch = -asin(deltaVec1.z / deltaVecLength1) * (180 / PI);
float yaw = atan2(deltaVec1.y, deltaVec1.x) * (180 / PI);

if (pitch >= -89 && pitch <= 89 && yaw >= -180 && yaw <= 180)
{
changeAngle((float)yaw, (float)pitch);
}

}``````

#### BDKPlayer

##### No hack no life
Dank Tier VIP
Dank Tier Donator
Since you are using origin instead of actual head positioning you are calculating the angle alpha which is equal to angle beta since you and the enemy have the same body height.

In some cases the head position will not be exactly above the enemies origin. One such example is your AWP screenshot. The guys is leaning forward. Your aimbot will always be off if the enemy origin and head are not exactly on a vertical line from your point of view:

Attention! Before you post:

99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

• Fill out the form correctly
• Tell us the game name & coding language