Solved CS:Go External Radar (draw calc)

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

dmo

Coder
Full Member
Nobleman
Nov 8, 2014
145
678
5
Hello,

I'm working in a external Radar now for CS:GO.
I got it to work +-.

My radar have a window only to draw it (300x300) (i'm doing like this because i have 2 monitors so i can use it better) :eek:

https://www.youtube.com/watch?v=n5PUAMdnQDA

C++:
float d[3]; //useless yet
float dist_ = distance(ESP::Inst().myPos, ESP::Inst().enemyPos, d);

float distX = ESP::Inst().enemyPos[0] - ESP::Inst().myPos[0];
float distY = ESP::Inst().enemyPos[1] - ESP::Inst().myPos[1];

if (dist_ >1)
Dot(150+(distX/30) ,150+(distY/30), 5, 5, 255, 0, 0, 255);
it's drawnning wrong, wrong position (inverted) and how i add a rotation to it. I tryed the w2s but well it's different i think.


Ty for your help!
 

GAFO666

Hacker
Meme Tier VIP
Aug 19, 2012
520
3,188
23
Im today realy nice, so I tell you my radar code :yo:

C++:
//Rage_Radar
void Rage_Client::RageRadarBase(LPDIRECT3DDEVICE9 dev, int x, int y, int w, int h, DWORD bCol, DWORD lCol)
{
	int with = w;
	int height = h;
	DrawFilledRect(x, y, with, height, bCol, dev);
	DrawBorderBox(x - 2, y - 2, with + 2, height + 2, 1, lCol, dev);
	DrawLine(dev, x + with / 2, y, x + with / 2, y + height, lCol);
	DrawLine(dev, x, y + height / 2, x + with, y + height / 2, lCol);
}

void Rage_Client::RageDrawEntOnRadar(LPDIRECT3DDEVICE9 dev, int x, int y, int w, int h, DWORD color, DWORD nvColor, C_BaseEntity *baseEnt, C_BasePlayer *LocalPlayer, bool Visible)
{

	if (!baseEnt || !LocalPlayer)
		return;

	float DrawLocal[2], DrawEntity[2];
	float RadCenter[2];
	int radMaxDis = 20;

	RadCenter[0] = x + w / 2;
	RadCenter[1] = y + h / 2;

	DrawLocal[0] = LocalPlayer->GetAbsOrigin().x;
	DrawLocal[1] = LocalPlayer->GetAbsOrigin().y;

	DrawEntity[0] = baseEnt->GetAbsOrigin().x;
	DrawEntity[1] = baseEnt->GetAbsOrigin().y;

	if (DrawEntity[0] == DrawLocal[0])
	{
		DrawEntity[0] += 0.0001;
	}
	if (DrawEntity[1] == DrawLocal[1])
	{
		DrawEntity[1] += 0.0001;
	}

	float delta_x = abs(DrawEntity[0] - DrawLocal[0]);
	float delta_y = abs(DrawEntity[1] - DrawLocal[1]);
	float Dist = pow(((pow(delta_x, 2)) + (pow(delta_y, 2))), 0.5);
	float yaw_id = atan(delta_y / delta_x) * 57.295779513082323;

	if (DrawEntity[0] < DrawLocal[0] && DrawEntity[1] > DrawLocal[1])
	{
		yaw_id = 180 - yaw_id;
	}
	else
	{
		if (DrawEntity[0] < DrawLocal[0] && DrawEntity[1] < DrawLocal[1])
		{
			yaw_id = -180 + yaw_id;
		}
		else
		{
			if (DrawEntity[0] > DrawLocal[0] && DrawEntity[1] < DrawLocal[1])
			{
				yaw_id = yaw_id * -1;
			}
		}
	}


	float yaw_delta = LocalPlayer->GetAbsAngles().y - yaw_id - 90;
	float temp_id_x = (cos(yaw_delta / 57.295779513082323) * Dist) / radMaxDis;
	float temp_id_y = (sin(yaw_delta / 57.295779513082323) * Dist) / radMaxDis;

	if (temp_id_x > ((w - 20) / 2) - 1)
	{
		temp_id_x = ((w - 20) / 2) - 1;
	}
	else
	{
		if (temp_id_x < -((w - 20) / 2) + 1)
		{
			temp_id_x = -((w - 20) / 2) + 1;
		}
	}
	if (temp_id_y >((h - 20) / 2) - 1)
	{
		temp_id_y = ((h - 20) / 2) - 1;
	}
	else
	{
		if (temp_id_y < -((h - 20) / 2) + 1)
		{
			temp_id_y = -((h - 20) / 2) + 1;
		}
	}


	if (!Visible)
	{
		DrawFilledRect(RadCenter[0] + temp_id_x, RadCenter[1] + temp_id_y, 4, 4, nvColor, dev);
	}
	else
	{
		DrawFilledRect(RadCenter[0] + temp_id_x, RadCenter[1] + temp_id_y, 4, 4, color, dev);
	}

}

//#################################################################################################################################################//
Notice:
Im nice today because Im drunk, dont ask me howto draw a rect or howto get the visibility ;D trololo but through that you will know how to rotate etc :) have fun mate !
 

c5

Kim Kong Trasher
Dank Tier VIP
Dank Tier Donator
Jul 19, 2012
1,187
12,638
76
Read rotation from camera/view apply mr sin and cos you learned about in the 8th grade and there you have it, a rotating radar.
 
Attention! Before you post:

Read the How to Ask Questions Guide
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
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods