Exemple #1
0
TEST( Space, WorldToScreenSpace )
{
    v3 pos = MAKE_v3( 0.0f, 0.0f, 0.0f );
    v2 mpos = MAKE_v2( 10.0f, 10.0f );

    v2 screenPos = WorldToScreen( pos, mpos );
    EXPECT_FLOAT_EQ( 10.0f, screenPos.x );
    EXPECT_FLOAT_EQ( 10.0f, screenPos.y );

    mpos.x = mpos.y = 320.0f;

    screenPos = WorldToScreen( pos, mpos );
    EXPECT_FLOAT_EQ( 320.0f, screenPos.x );
    EXPECT_FLOAT_EQ( 320.0f, screenPos.y );

    mpos.x = mpos.y = 0.0f;
    pos.x = 32.0f;

    screenPos = WorldToScreen( pos, mpos );
    EXPECT_FLOAT_EQ( 32.0f, screenPos.x );
    EXPECT_FLOAT_EQ( 0.0f, screenPos.y );

    pos.y = 32.0f;

    screenPos = WorldToScreen( pos, mpos );
    EXPECT_FLOAT_EQ( 32.0f, screenPos.x );
    EXPECT_FLOAT_EQ( 32.0f, screenPos.y );

    pos.x = pos.y = -32.0f;

    screenPos = WorldToScreen( pos, mpos );
    EXPECT_FLOAT_EQ( -32.0f, screenPos.x );
    EXPECT_FLOAT_EQ( -32.0f, screenPos.y );
}
Exemple #2
0
unsigned void* CMath::HookwBones(IClientEntity* pEnt, Color col)
{
	const model_t* pModel;
	pModel = pEnt->SetReturnModel();
	if (pModel)
	{
		studiohdr_t* pHdr = g_pModelInfoClient->SetReturnStudiomodel(pModel);
		if (!pHdr)
			return;

		mstudiobone_t* pBone;
		FloatArray4x3 vecBone, vecBoneChild, vecBoneOut, vecBoneChildOut;

		for (unsigned int k = 0; k < pHdr->numbones; k++)
		{
			pBone = pHdr->SetReturnBone(k);

			if ((pBone && (pBone->flags & (0x00000100)) && (pBone->parent != -1)))
			{
				SetReturnBonePosition(pEnt, k, vecBone);
				SetReturnBonePosition(pEnt, pBone->parent, vecBoneChild);

				if (WorldToScreen(vecBone, vecBoneOut) && WorldToScreen(vecBoneChild, vecBoneChildOut))
				{
					if (Varoables.esp_skeleton)
						ESP_Hookwing.FillLine(vecBoneOut.x, vecBoneOut.y, vecBoneChildOut.x, vecBoneChildOut.y, col);

					if (Varoables.esp_bonemarks)
						ESP_Hookwing.FillRGBA(vecBoneOut.x, vecBoneOut.y, 3, 3, col);
				}
			}
		}
	}
}
Exemple #3
0
void CDrawManager::DrawPlayerHealthBox(CBaseEntity *pEnt, DWORD dwColor, int iHealth, int iMaxHealth) {
	
	CEntity<> local{ me };

	if (pEnt == NULL)
		return;

	Vector mon, nom;

	nom = pEnt->GetAbsOrigin();

	if (!(local.get<int>(gEntVars.iFlags) & FL_DUCKING))
	{
		mon = nom + Vector(0, 0, 50.f);
	}
	else
	{
		mon = nom + Vector(0, 0, 70.f);
	}

	Vector bot, top;

	if (WorldToScreen(nom, bot) && WorldToScreen(mon, top))
	{
		float h = floor(bot.y - top.y);

		float w = h / 4.f;

		DWORD dwHealth;



		dwHealth = COLORCODE(255, 255, 255, 255); //white

		int first = floor(255 - (iHealth / iMaxHealth * 255 * 2.));
		int second = floor(iHealth / iMaxHealth * 255 * 2.);


		if (iMaxHealth*.5<iHealth) {
			dwHealth = COLORCODE(first, 255, 25, 255);
		}
		else {
			dwHealth = COLORCODE(255, second, 25, 255);
		}

		top.x -= floor(w + 6);
		DrawRect(floor(top.x), floor(top.y), 4, h, COLORCODE(0, 0, 0, 255)); // Border
		if (iMaxHealth<iHealth) {
			dwHealth = COLORCODE(0, 0, 255, 255);
			iHealth = iMaxHealth;
		}
		int hw = floor((((h)* iHealth) / iMaxHealth)); // Percentage I think?
		DrawRect(floor(top.x) + 1, floor(top.y + (h - hw)) + 1, 2, hw - 2, dwHealth);



	}

}
void CS16EngineInfo::VectorLine(float* From, float* To, float lw, COLOR32 Color)
{
	Vec3 ScreenSrc, ScreenDest;
	if (!WorldToScreen(From, ScreenSrc) || !WorldToScreen(To, ScreenDest))
		return;

	g_Core->Render->Line(ScreenSrc[0], ScreenSrc[1], ScreenDest[0], ScreenDest[1], lw, Color);
}
void CDebugDraw::DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color)
{
	b2Vec2 s1,s2;
	WorldToScreen(&s1,&p1);
	WorldToScreen(&s2,&p2);
	DWORD dColor = 0xff00ff00;
	m_pHge->Gfx_RenderLine(s1.x,s1.y,s2.x,s2.y,dColor);
}
Exemple #6
0
void Asset::drawSkeleton(mat *mat_world, bool names)
{
	auto sh_temp = Antimony::sh_current;
	Antimony::setShader(SHADERS_PLAIN);

	if (!m_animcontroller.skeleton.valid)
		return;

	for (UINT i = 0; i < m_animcontroller.skeleton.joints_sequential.size(); i++)
	{
		Joint *joint = m_animcontroller.skeleton.joints_sequential.at(i);
		mat mat_parent = joint->parent ? joint->parent->transform : mat_identity;
		mat mat_bone = joint->transform;
		/*mat mat_parent = joint->parent ? *m_animcontroller.skeleton.transform_sequential.at(joint->parent->index) : mat_identity;
		mat mat_bone = *m_animcontroller.skeleton.transform_sequential.at(i);*/

		mat s = MScalVector(m_scale * 0.01);									// asset's scale
		mat w = s * *mat_world;													// final world transform

		auto p_parent = WorldToScreen(V3Transform(v3_origin, mat_parent * w));
		auto p_origin = WorldToScreen(V3Transform(v3_origin, mat_bone * w));
		auto p_offset = WorldToScreen(V3Transform(v3_origin, MTranslation(0, 0.1, 0) * mat_bone * w));

		if (!joint->parent)
		{
			auto p = WorldToScreen(V3Transform(v3_origin, *mat_world));
			if (p.z > 0)
				Antimony::Draw2DDot(float2(p.x, p.y), 4, COLOR_BLUE);									// blue dot for origin
		}
		else
		{
			if (joint->children.size() == 0)
			{
				Antimony::Draw2DDot(float2(p_origin.x, p_origin.y), 4, COLOR_GREEN);					// green dot for dangling bone
			}
			else
			{
				Antimony::Draw2DDot(float2(p_origin.x, p_origin.y), 4, COLOR_BLUE);					// blue dot for joint between bones
				if (p_offset.z > 0 && names)
					Antimony::Consolas.render(joint->name.c_str(), 12, Antimony::display.right + p_offset.x + 1, Antimony::display.bottom + p_offset.y + 1, RGBA2DWORD(128, 128, 255, 255), NULL);
			}

			Antimony::Draw2DLineThin((float2)p_parent, (float2)p_origin, COLOR_BLUE, COLOR_BLUE);		// bone (blue line)
		}
	}

	Antimony::setShader(sh_temp);
}
Exemple #7
0
//==========================================================================
// ESP
//==========================================================================
//j_wrist_le - зап¤стие
//j_wrist_ri - зап¤стие
//j_brow_le - глаз
//j_brow_ri - глаз
//j_elbow_le - локоть
//j_elbow_ri - локоть
//j_clavicle_le - ключица
//j_clavicle_ri - ключица
//j_shoulder_le - плечо
//j_shoulder_ri - плечо
//j_neck - ше¤
//j_head - голова
//j_helmet - шлем
//j_jaw - челюсть
//j_spine[1-4] - позвоночник
//j_knee_le - колено
//j_knee_ri - колено
//torso_stabilizer - таз
//j_levator_ri - нос
//j_hiptwist_le - бедро
//j_hiptwist_ri - бедро
//j_ankle_le - стопа
//j_ankle_ri - стопа
//parentj_mainroot - последн¤¤ часть скелета
//j_ball_le - конец пальцев ног
//j_ball_ri - конец пальцев ног
void DrawBone(centity_t* entity, char* Start, char* End, float *colour)
{
	vec2_t startOrg, endOrg;
	vec3_t boneStart, boneEnd;
	GetBoneOriginID(entity, Start, boneStart);
	GetBoneOriginID(entity, End, boneEnd);
	int maxdist = 2; // If the player is not the bone, the line tends to be the center of the map.
	if (GetDistance(entity->lerpOrigin, boneStart) > maxdist || GetDistance(entity->lerpOrigin, boneEnd) > maxdist)
		return;

	if (WorldToScreen(boneStart, startOrg))
	{
		if (WorldToScreen(boneEnd, endOrg))
		{
			Draw.Line(startOrg[0], startOrg[1], endOrg[0], endOrg[1], colour);
		}
	}
}
void PS2Sprite3D::MoveDeltaZ(float z)
//  Move then recalculate 2D screen coords
{
	m_TopLeftWorld.z+=z;
	m_TopRightWorld.z+=z;
	m_BottomRightWorld.z+=z;
	m_BottomLeftWorld.z+=z;
	
	WorldToScreen();
}
void PS2Sprite3D::MoveDeltaY(float y)
//  Move then recalculate 2D screen coords
{
	m_TopLeftWorld.y+=y;
	m_TopRightWorld.y+=y;
	m_BottomRightWorld.y+=y;
	m_BottomLeftWorld.y+=y;
	
	WorldToScreen();
}
void PS2Sprite3D::MoveDeltaX(float x)
//  Move then recalculate 2D screen coords
{
	m_TopLeftWorld.x+=x;
	m_TopRightWorld.x+=x;
	m_BottomRightWorld.x+=x;
	m_BottomLeftWorld.x+=x;

	WorldToScreen();
}
Exemple #11
0
void CEntity::ReadBone(int iBone)
{
	if (!Valid)
		return;

	Bone[iBone].PositionInGame.x = Process->ReadMemory<float>(BoneAddress + 0x30 * iBone + 0x0C);
	Bone[iBone].PositionInGame.y = Process->ReadMemory<float>(BoneAddress + 0x30 * iBone + 0x1C);
	Bone[iBone].PositionInGame.z = Process->ReadMemory<float>(BoneAddress + 0x30 * iBone + 0x2C);
	Bone[iBone].IsOnScreen = WorldToScreen(Bone[iBone].PositionInGame, Bone[iBone].PositionOnScreen);
}
Exemple #12
0
void CEntity::ReadBoneFromMatrix(int iBone)
{
	if (!Valid)
		return;

	Bone[iBone].PositionInGame.x = BonesMatix[iBone].Matrix[0][3];
	Bone[iBone].PositionInGame.y = BonesMatix[iBone].Matrix[1][3];
	Bone[iBone].PositionInGame.z = BonesMatix[iBone].Matrix[2][3];
	Bone[iBone].IsOnScreen = WorldToScreen(Bone[iBone].PositionInGame, Bone[iBone].PositionOnScreen);
}
Exemple #13
0
void Autoshoot()
{
	if (Targets.empty() || !cFuncAutoShoot.bValue)
		return;

	clientInfo_t * ci = AimingAtClient( );
	if(ci && ci->team < TEAM_SPECTATOR && ( ci->team == TEAM_FREE || ci->team != bot.clientinfo[ bot.cg->clientNum ].team ))
	{
		Shoot = true;
		return;
	}

	for (int i = 0; i < Targets.size(); i++)
	{
		if (!Targets[i].enemy || !Targets[i].visible || !Targets[i].ci->infoValid || !Targets[i].alive)
			continue;

		if (cFuncAimbot.bValue && (int)cFuncAimType.iValue == FILTR_SILENTAIM && (Targets[i].fov_x < cFuncAimFov.iValue) && (Targets[i].fov_y < cFuncAimFov.iValue))
		{
			Shoot = true;
			return;
		}

		vec3_t vOutAnkle, vOutHelmet;
		vec2_t fScreenAnkle, fScreenHelmet;
		GetBoneOriginID(Targets[i].cent, "j_head", vOutHelmet);
		GetBoneOriginID(Targets[i].cent, "j_ankle_ri", vOutAnkle);

		if (WorldToScreen(vOutAnkle, fScreenAnkle) && WorldToScreen(vOutHelmet, fScreenHelmet))
		{
			float RectYoffset = ((fScreenAnkle[1]+35) - fScreenHelmet[1]);
			float RectWidth = (RectYoffset/3);
			float RectWidthPos = (fScreenHelmet[0] - (RectWidth/2));
			int ScreenCenterX = bot.cg->refdef.width/2;
			int ScreenCenterY = bot.cg->refdef.height/2;

			if((ScreenCenterX >= RectWidthPos && ScreenCenterX <= RectWidthPos+RectWidth) && (ScreenCenterY >= fScreenHelmet[1]-(RectYoffset/6) && ScreenCenterY <= fScreenAnkle[1])) {
				if (cFuncAutoShoot.bValue) Shoot = true;
			}
		}
	}
}
Exemple #14
0
/**  
 * Transforms a point from the view's world-space into the view's screen-space.  
 * Divides the resulting X, Y, Z by W before returning. 
 */
FPlane FSceneView::Project(const FVector& WorldPoint) const
{
	FPlane Result = WorldToScreen(WorldPoint);

	if (Result.W == 0)
	{
		Result.W = KINDA_SMALL_NUMBER;
	}

	const float RHW = 1.0f / Result.W;

	return FPlane(Result.X * RHW,Result.Y * RHW,Result.Z * RHW,Result.W);
}
Exemple #15
0
qbool WorldToScreen3D(centity_t *cent, vec2_t Screen, float height, float angle, float dist)
{
	if (cent->lerpAngles[1] < 0) cent->lerpAngles[1] = (360 + cent->lerpAngles[1]);
	float vAngle = cent->lerpAngles[1] + angle;
	vec3_t vPos;
	vPos[0] = cent->lerpOrigin[0] + (float)(dist * (float)cos(vAngle / 58.0f));
	vPos[1] = cent->lerpOrigin[1] + (float)(dist * (float)sin(vAngle / 58.0f));
	vPos[2] = cent->lerpOrigin[2] + height;

	vec2_t vScreen;
	if (!WorldToScreen(vPos, vScreen)) return qfalse;
	Screen[0] = vScreen[0];
	Screen[1] = vScreen[1];
	return qtrue;
}
void PS2Sprite3D::MoveTo(float x, float y, float z)
//  Move sprite to new location, maintain orientation
//  just subtract a vector from the position vectors to
//  find new points.
{
	float dx = m_TopLeftWorld.x - x;
	float dy = m_TopLeftWorld.y - y;
	float dz = m_TopLeftWorld.z - z;
	
	Vector4 temp(dx, dy, dz, 1);
	
	m_TopLeftWorld = m_TopLeftWorld - temp;
	m_TopRightWorld = m_TopRightWorld - temp;
	m_BottomLeftWorld = m_BottomLeftWorld - temp;
	m_BottomRightWorld = m_BottomRightWorld - temp;
	
	WorldToScreen();		//  Recalculate the screen coordinates
}
Exemple #17
0
//===================================================================================
void CDrawManager::DrawBox(Vector vOrigin, int r, int g, int b, int alpha, int box_width, int radius)
{
	Vector vScreen;

	if(!WorldToScreen(vOrigin, vScreen))
		return;

	int radius2 = radius << 1;

	//outlines
	OutlineRect(vScreen.x - radius + box_width, vScreen.y - radius + box_width, radius2 - box_width, radius2 - box_width, COLORCODE(0, 255, 0, 255));
	OutlineRect(vScreen.x - radius - 1, vScreen.y - radius - 1, radius2 + (box_width + 2), radius2 + (box_width + 2), COLORCODE(0, 255, 0, 255));

	//actual lines
	DrawRect(vScreen.x - radius + box_width, vScreen.y - radius, radius2 - box_width, box_width, COLORCODE(r, g, b, alpha));
	DrawRect(vScreen.x - radius, vScreen.y + radius, radius2, box_width, COLORCODE(r, g, b, alpha));
	DrawRect(vScreen.x - radius, vScreen.y - radius, box_width, radius2, COLORCODE(r, g, b, alpha));
	DrawRect(vScreen.x + radius, vScreen.y - radius, box_width, radius2 + box_width, COLORCODE(r, g, b, alpha));
}
Exemple #18
0
unsigned void* CMath::DynamicCords(IClientEntity* pEnt, unsigned int& iMinX, unsigned int& iMinY, unsigned int& iMaxX, unsigned int& iMaxY)
{
	FloatArray4x3 vecMin, vecMax;
	vecMin = pEnt->m_vecMaxs() + pEnt->SetReturnOrigin();
	vecMax = pEnt->m_vecMins() + pEnt->SetReturnOrigin();

	FloatArray4x3 vecEdges[8] =
		{
			FloatArray4x3(vecMin.x, vecMin.y, vecMin.z),
			FloatArray4x3(vecMin.x, vecMin.y, vecMax.z),
			FloatArray4x3(vecMin.x, vecMax.y, vecMin.z),
			FloatArray4x3(vecMin.x, vecMax.y, vecMax.z),
			FloatArray4x3(vecMax.x, vecMin.y, vecMin.z),
			FloatArray4x3(vecMax.x, vecMin.y, vecMax.z),
			FloatArray4x3(vecMax.x, vecMax.y, vecMin.z),
			FloatArray4x3(vecMax.x, vecMax.y, vecMax.z)
		};

	iMinX = pScreenSize.m_iWidth * 2;
	iMinY = pScreenSize.m_iHeight * 2;
	iMaxX = 0;
	iMaxY = 0;

	for (unsigned int iIndex = 1; iIndex < 8; iIndex++)
	{
		FloatArray4x3 vecCorner = vecEdges[iIndex];
		FloatArray4x3 vecScreen;

		if (WorldToScreen(vecCorner, vecScreen))
		{
			iMinX = min(iMinX, vecScreen.x);
			iMinY = min(iMinY, vecScreen.y);
			iMaxX = max(iMaxX, vecScreen.x);
			iMaxY = max(iMaxY, vecScreen.y);
		}
	}
}
Exemple #19
0
void __fastcall hkPaintTraverse(void* ecx, void* edx, unsigned int vguiPanel, bool forceRepaint, bool allowForce)
{
	oPaintTraverse(ecx, vguiPanel, forceRepaint, allowForce);

	static unsigned int MatSystemTopPanel;
	static vgui::HFont s_HFontPlayer;

	if (!MatSystemTopPanel)
	{
		const char* szName = ipanel()->GetName(vguiPanel);
		g_pCVar->ConsoleColorPrintf(Color::Blue(), "panel: %s\n", szName);

		if (_V_stricmp(szName, "MatSystemTopPanel") == 0) // MatSystemTopPanel
		{
			MatSystemTopPanel = vguiPanel;

			engine->GetScreenSize(screenWidth, screenHeight);
			s_HFontPlayer = g_pMatSurface->CreateFont();
			g_pMatSurface->SetFontGlyphSet(s_HFontPlayer, "Tahoma", 14, 150, 0, 0, FONTFLAG_OUTLINE);
		}
	}
	

	if (MatSystemTopPanel == vguiPanel)
	{
		if (GetAsyncKeyState(VK_F9) & 1)
		{
			name = !name;
			if (name) Beep(0x367, 200);
			else Beep(0x255, 200);
		}

		if (engine->IsInGame() && engine->IsConnected() && !engine->IsTakingScreenshot())
		{

			if (GetAsyncKeyState(VK_F11) & 1)
			{
				g_pCVar->ConsoleColorPrintf(Color::Red(), "Hello World!");
			}

			C_BaseEntity *pLocalEntity = (C_BaseEntity*)entitylist->GetClientEntity(engine->GetLocalPlayer());
			if (!pLocalEntity)
				return;


			for (int i = 0; i < entitylist->GetHighestEntityIndex(); i++)
			{
				C_BaseEntity* pBaseEntity = (C_BaseEntity*)entitylist->GetClientEntity(i);
				if (!pBaseEntity)
					continue;
				if (pBaseEntity->health() < 1)
					continue;
				if (pBaseEntity == pLocalEntity)
					continue;
				if (pLocalEntity->team() == pBaseEntity->team())
					continue;

				if (name)
				{
					Vector out;
					if (WorldToScreen(pBaseEntity->GetAbsOrigin(), out))
					{
						if (name)
						{
							player_info_t info;
							engine->GetPlayerInfo(i, &info);
							DrawString(out.x - 5, out.y, Color::Red(), s_HFontPlayer, info.name);
						}
					}
				}
			}
		}
	}
}
Exemple #20
0
//==========================================================================
// VISUAL
//==========================================================================
void Visual()
{
	if (cFuncVisualWH.bValue)Hook->MemoryWrite((void*)bot.Wallhack, (void*)"\xC7\x44\x24\x14\x88\x00\x00", 7);
	else Hook->MemoryWrite((void*)bot.Wallhack, (void*)"\xC7\x44\x24\x14\x80\x00\x00", 7);

	if (cFuncVisualGranade.bValue || cFuncVisualMG.bValue)
	{
		vec2_t screen;
		for (int i = 64; i < MAX_GENTITIES; i++)
		{
			if (WorldToScreen(bot.cg_entities[i].lerpOrigin, screen))
			{
				if (bot.cg_entities[i].currentState.eType == 4 && cFuncVisualGranade.bValue)
				{
					vec4_t colour;
					float dist = GetDistance(bot.cg->refdef.vieworg, bot.cg_entities[i].lerpOrigin);
					if (dist < 5)
					{
						Draw.Text(bot.cg->refdef.width/2, 50, 2, colorRed, F_CENTER, bot.fonts.Normal, "GRANADE");
						CopyVec4(colour, colorRed);
					}
					else if (dist < 8)
						CopyVec4(colour, colorOrange);
					else CopyVec4(colour, colorGreen);
					Draw.Text(screen[0], screen[1]-20, 1.0, colour, F_CENTER, bot.fonts.Normal, "[ %im ]", (int)dist);
					Draw.Shader(screen[0]-25, screen[1]-25, 50, 50, colour, bot.shaders.GrenadeIcon);
				}
				
				if (bot.cg_entities[i].currentState.eType == 9 && cFuncVisualMG.bValue)
				{
					Draw.Text(screen[0], screen[1], 1.2, colorCyan, F_CENTER, bot.fonts.Console, "MG");
				}
			}
		}
	}

	int x = bot.cg->refdef.width/2;
	int y = bot.cg->refdef.height/2;
	if (cFuncVisualCross.iValue == FILTR_CROSSCIRCLE)
		Draw.Shader(x-5, y-5, 10, 10, colorWhite, bot.shaders.RadarEnemy);
	else if (cFuncVisualCross.iValue == FILTR_CROSSCROSSBIG)
	{
		Draw.Shader(x-1, y-25, 2, 50, colorYellow, bot.shaders.White);
		Draw.Shader(x-25, y-1, 50, 2, colorYellow, bot.shaders.White);

		Draw.Shader(x-1, y-15, 2, 8, colorBlack, bot.shaders.White);
		Draw.Shader(x+7, y-1, 8, 2, colorBlack, bot.shaders.White);
		Draw.Shader(x-1, y+7, 2, 8, colorBlack, bot.shaders.White);
		Draw.Shader(x-15, y-1, 8, 2, colorBlack, bot.shaders.White);
	}
	else if (cFuncVisualCross.iValue == FILTR_CROSSCROSSSMALL)
	{
		Draw.Shader(x-1, y-8, 2, 16, colorYellow, bot.shaders.White);
		Draw.Shader(x-8, y-1, 16, 2, colorYellow, bot.shaders.White);
	}
	else if (cFuncVisualCross.iValue == FILTR_CROSSSQUARE)
	{
		int size = 15, leng = 5;
		Draw.Shader(x-size, y-size, leng, 2, colorGreen, bot.shaders.White);
		Draw.Shader(x-size, y-size, 2, leng, colorGreen, bot.shaders.White);

		Draw.Shader(x+(size-leng), y-size, leng, 2, colorGreen, bot.shaders.White);
		Draw.Shader(x+size, y-size, 2, leng, colorGreen, bot.shaders.White);

		Draw.Shader(x+(size-leng), y+size, leng+2, 2, colorGreen, bot.shaders.White);
		Draw.Shader(x+size, y+(size-leng), 2, leng, colorGreen, bot.shaders.White);

		Draw.Shader(x-size, y+size, leng, 2, colorGreen, bot.shaders.White);
		Draw.Shader(x-size, y+(size-leng), 2, leng, colorGreen, bot.shaders.White);

		Draw.Shader(x-2, y-2, 4, 4, colorGreen, bot.shaders.White);
	}
}
Exemple #21
0
void Esp()
{
	if (!Targets.empty())
	{
		vec4_t clEnemyVIS = { cFuncESPEnemyVISR.iValue/255.0f, cFuncESPEnemyVISG.iValue/255.0f, cFuncESPEnemyVISB.iValue/255.0f, 1.0f };
		vec4_t clEnemyINVIS = { cFuncESPEnemyUNVISR.iValue/255.0f, cFuncESPEnemyUNVISG.iValue/255.0f, cFuncESPEnemyUNVISB.iValue/255.0f, 1.0f };
		vec4_t clFriendyVIS = { cFuncESPFriendVISR.iValue/255.0f, cFuncESPFriendVISG.iValue/255.0f, cFuncESPFriendVISB.iValue/255.0f, 1.0f };
		vec4_t clFriendINVIS = { cFuncESPFriendUNVISR.iValue/255.0f, cFuncESPFriendUNVISG.iValue/255.0f, cFuncESPFriendUNVISB.iValue/255.0f, 1.0f };
		
		for (int i = 0; i < Targets.size(); i++)
		{
			if (!Targets[i].alive || (Targets[i].enemy && cFuncESPFilter.iValue == FILTR_ESPFRIENDS) || 
				(!Targets[i].enemy && cFuncESPFilter.iValue == FILTR_ESPENEMY) || (bot.cg->snap->ps.clientNum == Targets[i].ci->clientNum))
				continue;

			vec4_t colour;
			if (Targets[i].enemy)
			{
				if (Targets[i].visible)
					CopyVec4(colour, clEnemyVIS);
				else
					CopyVec4(colour, clEnemyINVIS);
			}
			else {
				if (Targets[i].visible)
					CopyVec4(colour, clFriendyVIS);
				else
					CopyVec4(colour, clFriendINVIS);
			}

			float	fov_x	= *(float*)((DWORD)GetModuleHandleA("gfx_d3d_mp_x86_s.dll") + bot.Fov_x);

			if (cFuncESP3Dbox.bValue)
			{
				Draw3DBox(Targets[i], colour);
			}

			if (cFuncESP2Dbox.bValue)
			{
				vec3_t orgUP, orgDown;
				vec2_t crdUP, crdDown;
				GetBoneOriginID(Targets[i].cent, "j_helmet", orgUP);
				CopyVec3(orgDown, Targets[i].cent->lerpOrigin);
				if (WorldToScreen(orgUP, crdUP) && WorldToScreen(orgDown, crdDown))
				{
					float width = 400.0f;
					float x = crdDown[0]-((width / Targets[i].distance * fov_x)/2);
					float y = crdUP[1];
					float w = (width / Targets[i].distance * fov_x);
					float h = crdDown[1] - crdUP[1];
					Draw.Border(x, y, w, h, 2, colour);
				}
			}

			if (cFuncESPSkeleton.bValue)
			{
				DrawBone(Targets[i].cent, "j_head_end", "j_head", colour);
				DrawBone(Targets[i].cent, "j_head", "j_neck", colour);
				DrawBone(Targets[i].cent, "j_neck", "j_clavicle_le", colour);
				DrawBone(Targets[i].cent, "j_neck", "j_clavicle_ri", colour);

				DrawBone(Targets[i].cent, "j_clavicle_le", "j_shoulder_le", colour);
				DrawBone(Targets[i].cent, "j_shoulder_le", "j_elbow_le", colour);
				DrawBone(Targets[i].cent, "j_elbow_le", "j_wrist_le", colour);

				DrawBone(Targets[i].cent, "j_clavicle_ri", "j_shoulder_ri", colour);
				DrawBone(Targets[i].cent, "j_shoulder_ri", "j_elbow_ri", colour);
				DrawBone(Targets[i].cent, "j_elbow_ri", "j_wrist_ri", colour);

				DrawBone(Targets[i].cent, "j_neck", "j_spine4", colour);
				DrawBone(Targets[i].cent, "j_spine4", "j_spine3", colour);
				DrawBone(Targets[i].cent, "j_spine3", "j_spine2", colour);
				DrawBone(Targets[i].cent, "j_spine2", "j_spine1", colour);
				DrawBone(Targets[i].cent, "j_spine1", "torso_stabilizer", colour);

				DrawBone(Targets[i].cent, "torso_stabilizer", "j_hiptwist_le", colour);
				DrawBone(Targets[i].cent, "j_hiptwist_le", "j_knee_le", colour);
				DrawBone(Targets[i].cent, "j_knee_le", "j_ankle_le", colour);
				DrawBone(Targets[i].cent, "j_ankle_le", "j_ball_le", colour);

				DrawBone(Targets[i].cent, "torso_stabilizer", "j_hiptwist_ri", colour);
				DrawBone(Targets[i].cent, "j_hiptwist_ri", "j_knee_ri", colour);
				DrawBone(Targets[i].cent, "j_knee_ri", "j_ankle_ri", colour);
				DrawBone(Targets[i].cent, "j_ankle_ri", "j_ball_ri", colour);
			}

			if (cFuncESPLines.bValue)
			{
				vec2_t screen;
				vec3_t org;
				GetBoneOriginID(Targets[i].cent, "j_spine1", org);
				if(WorldToScreen(org, screen))
				{
					float x = bot.cg->refdef.width/2;
					float y = bot.cg->refdef.height;
					Draw.Line(x, y, screen[0], screen[1], colour, 1);
				}
			}

			LPSTR font;
			switch (cFuncESPFont.iValue)
			{
			case FILTR_BIG:
				font = bot.fonts.Big;
				break;
			case FILTR_NORMAL:
				font = bot.fonts.Normal;
				break;
			case FILTR_SMALL:
				font = bot.fonts.Small;
				break;
			case FILTR_BOLD:
				font = bot.fonts.Bold;
			default:
				font = bot.fonts.Big;
				break;
			}

			vec3_t org_helmet; vec2_t screen1, screen2;
			GetBoneOriginID(Targets[i].cent, "j_helmet", org_helmet);
			if(WorldToScreen(org_helmet, screen1) && WorldToScreen(Targets[i].cent->lerpOrigin, screen2))
			{
				string name = strip_color(string(Targets[i].ci->name));
				name = strip_color(name);

				if (cFuncESPNames.bValue)
					Draw.Text(screen1[0], screen1[1], 0.8, colour, F_CENTER, font, "%s", name.c_str());
				if (cFuncESPDistance.bValue)
					Draw.Text(screen2[0], screen2[1], 0.9, colour, F_CENTER, font, "%im", (int)Targets[i].distance);
			}
		}
	}
}
Exemple #22
0
/** Transforms a point from the view's world-space into pixel coordinates relative to the view's X,Y. */
bool FSceneView::WorldToPixel(const FVector& WorldPoint,FVector2D& OutPixelLocation) const
{
	const FVector4 ScreenPoint = WorldToScreen(WorldPoint);
	return ScreenToPixel(ScreenPoint, OutPixelLocation);
}
Exemple #23
0
unsigned void* CMath::HookwBox(FloatArray4x3* vecPoints, Color col)
{
	FloatArray4x3 vecStartPos, vecEndPos;

	g_pSurface->HookwSetColor(col);

	for (unsigned int i = 0; i < 3; i++)
	{
		if (WorldToScreen(vecPoints[i], vecStartPos) && WorldToScreen(vecPoints[i + 1], vecEndPos))
			g_pSurface->HookwLine(vecStartPos.x, vecStartPos.y, vecEndPos.x, vecEndPos.y);
	}

	if (WorldToScreen(vecPoints[0], vecStartPos) && WorldToScreen(vecPoints[3], vecEndPos))
		g_pSurface->HookwLine(vecStartPos.x, vecStartPos.y, vecEndPos.x, vecEndPos.y);

	for (unsigned int i = 4; i < 7; i++)
	{
		if (WorldToScreen(vecPoints[i], vecStartPos) && WorldToScreen(vecPoints[i + 1], vecEndPos))
			g_pSurface->HookwLine(vecStartPos.x, vecStartPos.y, vecEndPos.x, vecEndPos.y);
	}

	if (WorldToScreen(vecPoints[4], vecStartPos) && WorldToScreen(vecPoints[7], vecEndPos))
		g_pSurface->HookwLine(vecStartPos.x, vecStartPos.y, vecEndPos.x, vecEndPos.y);

	if (WorldToScreen(vecPoints[0], vecStartPos) && WorldToScreen(vecPoints[6], vecEndPos))
		g_pSurface->HookwLine(vecStartPos.x, vecStartPos.y, vecEndPos.x, vecEndPos.y);

	if (WorldToScreen(vecPoints[1], vecStartPos) && WorldToScreen(vecPoints[5], vecEndPos))
		g_pSurface->HookwLine(vecStartPos.x, vecStartPos.y, vecEndPos.x, vecEndPos.y);

	if (WorldToScreen(vecPoints[2], vecStartPos) && WorldToScreen(vecPoints[4], vecEndPos))
		g_pSurface->HookwLine(vecStartPos.x, vecStartPos.y, vecEndPos.x, vecEndPos.y);

	if (WorldToScreen(vecPoints[3], vecStartPos) && WorldToScreen(vecPoints[7], vecEndPos))
		g_pSurface->HookwLine(vecStartPos.x, vecStartPos.y, vecEndPos.x, vecEndPos.y);
}
Exemple #24
0
int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
                     _In_opt_ HINSTANCE hPrevInstance,
                     _In_ LPTSTR    lpCmdLine,
                     _In_ int       nCmdShow)
{
	HWND hWnd;
	WNDCLASSEX wc;

	ZeroMemory(&wc, sizeof(WNDCLASSEX));

	wc.cbSize = sizeof(WNDCLASSEX);
	wc.style = CS_HREDRAW | CS_VREDRAW;
	wc.lpfnWndProc = WndProc;
	wc.hInstance = hInstance;
	wc.hCursor = LoadCursor(NULL, IDC_ARROW);
	wc.hbrBackground = (HBRUSH)RGB(0, 0, 0);
	wc.lpszClassName = "WindowClass";

	RegisterClassEx(&wc);	

		hWnd = CreateWindowEx(NULL,
			"WindowClass",
			"DirectX Test",
			WS_EX_TOPMOST | WS_POPUP,
			0, 0,
			SCREEN_WIDTH, SCREEN_HEIGHT,
			NULL,
			NULL,
			hInstance,
			NULL);


	SetWindowLong(hWnd, GWL_EXSTYLE, (int)GetWindowLong(hWnd, GWL_EXSTYLE) | WS_EX_LAYERED | WS_EX_TRANSPARENT);
	//SetLayeredWindowAttributes(hWnd, RGB(0, 0, 0), 0, ULW_COLORKEY);
	SetLayeredWindowAttributes(hWnd, RGB(0, 0, 0), 255, LWA_ALPHA);

	ShowWindow(hWnd, nCmdShow);

	// set up and initialize Direct3D
	initD3D(hWnd);	

	DWORD   dwThreadIdArray[MAX_THREADS];
	HANDLE  hThreadArray[MAX_THREADS];
	
	for (int i = 0; i < MAX_THREADS; i++)
	{
		hThreadArray[i] = CreateThread(
			NULL,
			0,
			(LPTHREAD_START_ROUTINE)mainThread,
			NULL,
			0,
			&dwThreadIdArray[i]);
	}
	
	m_Rect.left = 0;
	m_Rect.top = 0;
	m_Rect.right = SCREEN_WIDTH;
	m_Rect.bottom = SCREEN_HEIGHT;

	D3DXCreateFont(d3ddev, 10, 0, FW_BOLD, 1, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial", &pFont);
	// enter the main loop:
	MSG msg;
	::SetWindowPos(FindWindow(NULL, LGameWindow), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
	while (TRUE)
	{		
		Sleep(10);		
		::SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, NULL);		
		
		while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
		{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}

		if (msg.message == WM_QUIT)
			break;

		HWND hGameWindow = NULL;
		HANDLE hProcHandle = NULL;
		float vPunchX = NULL;
		float vPunchY = NULL;
		float vPunchZ = NULL;

		if (GetAsyncKeyState(VK_OEM_PLUS))
		{
			RectSize += 0.1f;
		}

		if (GetAsyncKeyState(VK_OEM_MINUS))
		{
			if (RectSize > 1)
			{
				RectSize -= 0.1f;
			}
		}

		if (GetAsyncKeyState(VK_NUMPAD7))
		{
			aimbotSize += 1;
		}
		if (GetAsyncKeyState(VK_NUMPAD8))
		{
			aimbotSize -= 1;
		}

		if (GetAsyncKeyState(VK_NUMPAD5))
		{
			readBone += 1;
			Sleep(200);
		}
		if (GetAsyncKeyState(VK_NUMPAD6) && readBone != 0)
		{
			readBone -= 1;
			Sleep(200);
		}

		hGameWindow = FindWindow(NULL, LGameWindow);
		if (hGameWindow)
		{
			GetWindowThreadProcessId(hGameWindow, &dwProcID);
			if (dwProcID != 0)
			{
				hProcHandle = OpenProcess(PROCESS_ALL_ACCESS, false, dwProcID);
				if (hProcHandle == INVALID_HANDLE_VALUE || hProcHandle == NULL)
				{
					IsGameAvail = false;
				}
				else
				{
					IsGameAvail = true;
				}
			}
		}

		if (IsGameAvail)
		{
			GetWindowRect(FindWindow(NULL, LGameWindow), &m_Rect);

			if (GetAsyncKeyState(VK_NUMPAD9))
			{
				toggle = false;
				radar = false;
				trigger = false;
				norecoil = false;
			}

			if (GetAsyncKeyState(VK_NUMPAD1))
			{
				toggle = true;
			}

			if (GetAsyncKeyState(VK_NUMPAD2))
			{
				radar = true;
			}

			if (GetAsyncKeyState(VK_NUMPAD3))
			{
				trigger = true;
			}

			if (GetAsyncKeyState(VK_NUMPAD4))
			{
				norecoil = true;
			}

			if (toggle)
			{

				DWORD ClientBase = Module("client.dll");
				DWORD temp1 = ClientBase + LocalPlayer;
				ReadProcessMemory(hProcHandle, (LPCVOID)temp1, &dwLocalPlayer, 4, NULL);

				/* Reads the value of InCross */
				DWORD inCross = dwLocalPlayer + InCrosshair;
				DWORD ReadInCross = inCross;

				DWORD Lpitch = dwLocalPlayer + viewOffsetX;
				DWORD Lyaw = dwLocalPlayer + viewOffsetY;

				ReadProcessMemory(hProcHandle, (LPCVOID)Lpitch, &localPlayerStruct.pitch, sizeof(localPlayerStruct.viewAng), 0);
				ReadProcessMemory(hProcHandle, (LPCVOID)Lyaw, &localPlayerStruct.yaw, sizeof(localPlayerStruct.yaw), 0);

				ReadProcessMemory(hProcHandle, (LPCVOID)ReadInCross, &vInCross, sizeof(vInCross), 0);

				/* Read the value of LocalPlayer-TeamNum */
				DWORD LTeamNum = dwLocalPlayer + teamNumber;
				DWORD ReadLTeamNum = LTeamNum;
				
				ReadProcessMemory(hProcHandle, (LPCVOID)ReadLTeamNum, &vLTeamNum, sizeof(vLTeamNum), 0);

				DWORD LPosX = dwLocalPlayer + PositionX;
				DWORD LPosY = dwLocalPlayer + PositionY;
				DWORD LPosZ = dwLocalPlayer + PositionZ;

				ReadProcessMemory(hProcHandle, (LPCVOID)LPosX, &localPlayerStruct.Position[0], sizeof(localPlayerStruct.Position[0]), 0);
				ReadProcessMemory(hProcHandle, (LPCVOID)LPosY, &localPlayerStruct.Position[1], sizeof(localPlayerStruct.Position[1]), 0);
				ReadProcessMemory(hProcHandle, (LPCVOID)LPosZ, &localPlayerStruct.Position[2], sizeof(localPlayerStruct.Position[2]), 0);

				localPlayerStruct.teamNum = vLTeamNum;


				DWORD temp51 = ClientBase + ViewMatrix;
				ReadProcessMemory(hProcHandle, (LPCVOID)temp51, &localPlayerStruct.WorldToScreenMatrix, sizeof(localPlayerStruct.WorldToScreenMatrix), 0);

				TargetsInfo* targetsInfo = new TargetsInfo[64];

				DWORD temp100 = Module("client.dll") + 0x4A3554C + 0x50;
				DWORD temp101;

				ReadProcessMemory(hProcHandle, (LPCVOID)temp100, &temp101, sizeof(temp101), NULL);

				int targetLoop = 0;
				/* Read the Value of EnityList-TeamNum */
				for (int i = 0; i < 64; i++)
				{
					DWORD temp2 = ClientBase + EntityList + (i * EntitySize);
					ReadProcessMemory(hProcHandle, (LPCVOID)temp2, &playersInfo[i].playerAddress, sizeof(playersInfo[i].playerAddress), NULL);
					DWORD temp3 = playersInfo[i].playerAddress + teamNumber;
					ReadProcessMemory(hProcHandle, (LPCVOID)temp3, &playersInfo[i].teamNum, sizeof(playersInfo[i].teamNum), NULL);

					DWORD posX = playersInfo[i].playerAddress + PositionX;
					DWORD posY = playersInfo[i].playerAddress + PositionY;
					DWORD posZ = playersInfo[i].playerAddress + PositionZ;

					DWORD temp102 = temp101 + 0x1E0 * i;

					DWORD temp103 = temp102 + 0x24;

					ReadProcessMemory(hProcHandle, (LPCVOID)temp103, &playersInfo[i].Name, sizeof(playersInfo[i].Name), NULL);

					ReadProcessMemory(hProcHandle, (LPCVOID)posX, &playersInfo[i].Position[0], sizeof(playersInfo[i].Position[0]), NULL);
					ReadProcessMemory(hProcHandle, (LPCVOID)posY, &playersInfo[i].Position[1], sizeof(playersInfo[i].Position[1]), NULL);
					ReadProcessMemory(hProcHandle, (LPCVOID)posZ, &playersInfo[i].Position[2], sizeof(playersInfo[i].Position[2]), NULL);

					DWORD LifeState = playersInfo[i].playerAddress + LifeStatus;

					ReadProcessMemory(hProcHandle, (LPCVOID)LifeState, &playersInfo[i].lifeState, sizeof(playersInfo[i].lifeState), NULL);

					DWORD boneAddress = playersInfo[i].playerAddress + BoneMatrix;

					ReadProcessMemory(hProcHandle, (LPCVOID)boneAddress, &playersInfo[i].boneMatrixAddress, sizeof(playersInfo[i].boneMatrixAddress), NULL);

					GetBonePosition(readBone, i, hProcHandle);

					// Read the value of Health
					DWORD LHealth = playersInfo[i].playerAddress + HealthOff;
					DWORD ReadLHealth = LHealth;
					ReadProcessMemory(hProcHandle, (LPCVOID)ReadLHealth, &vLHealth, sizeof(vLHealth), 0);
					playersInfo[i].Health = vLHealth;

					playersInfo[i].distance = Get3dDistance(localPlayerStruct.Position, playersInfo[i].Position);

					float width = (ESPwidth / playersInfo[i].distance) * 0.5;
					float height = (ESPheight / playersInfo[i].distance) * 0.65;

					if (playersInfo[i].teamNum == localPlayerStruct.teamNum)
						continue;

					if (playersInfo[i].Health < 1)
						continue;

					if (playersInfo[i].lifeState == 0)
						continue;

					if (!WorldToScreen(playersInfo[i].boneXYZ, BoneXY))
						continue;

					if (BoneXY[0] < (SCREEN_WIDTH / 2) - aimbotSize || BoneXY[0] > (SCREEN_WIDTH / 2) + aimbotSize)
						continue;

					if (BoneXY[1] < (SCREEN_HEIGHT / 2) - aimbotSize || BoneXY[1] > (SCREEN_HEIGHT / 2) + aimbotSize)
						continue;

					targetsInfo[targetLoop] = TargetsInfo(localPlayerStruct.Position, playersInfo[i].Position, BoneXY);
					

					targetLoop++;

					
				}
				
				if (targetLoop > 0)
				{
					std::sort(targetsInfo, targetsInfo + targetLoop, CompareTargetEnArray());

					if (GetAsyncKeyState(0x45))
					{
						mouse_event(MOUSEEVENTF_ABSOLUTE, targetsInfo[0].AimXY[0] - (m_Rect.right / 2),
							targetsInfo[0].AimXY[1] - (m_Rect.bottom / 2), 0, 0);
					}
				}

				targetLoop = 0;

				delete [] targetsInfo;

				if (vInCross < 64 && vInCross > 0)
				{
					if (vLTeamNum != playersInfo[vInCross - 1].teamNum
						&& playersInfo[vInCross - 1].lifeState != 0
						&& !GetAsyncKeyState(0x01)
						&& trigger)
					{
						mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
						mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
					}
				}
				/*
				if (GetAsyncKeyState(0x01) && norecoil)
				{
					DWORD Lpitch = dwLocalPlayer + viewOffsetX;
					DWORD Lyaw = dwLocalPlayer + viewOffsetY;

					ReadProcessMemory(hProcHandle, (LPCVOID)Lpitch, &localPlayerStruct.pitch, sizeof(localPlayerStruct.viewAng), 0);
					ReadProcessMemory(hProcHandle, (LPCVOID)Lyaw, &localPlayerStruct.yaw, sizeof(localPlayerStruct.yaw), 0);

					DWORD anglePunchX = dwLocalPlayer + PunchX;
					DWORD anglePunchY = dwLocalPlayer + PunchY;

					float aPunchX;
					float aPunchY;

					ReadProcessMemory(hProcHandle, (LPCVOID)anglePunchX, &aPunchX, sizeof(aPunchX), NULL);
					ReadProcessMemory(hProcHandle, (LPCVOID)anglePunchY, &aPunchY, sizeof(aPunchY), NULL);

					DWORD temp40 = Module("engine.dll") + EPointer;
					DWORD temp41;
					
					ReadProcessMemory(hProcHandle, (LPCVOID)temp40, &temp41, sizeof(temp41), NULL);

					DWORD temp42 = temp41 + 0x4C90;
					DWORD temp43 = temp41 + 0x4C94;

					if (aPunchX < 0.001f && aPunchY < 0.001f)
						continue;

					localPlayerStruct.pitch -= aPunchX * 2.0f;
					localPlayerStruct.yaw -= aPunchY * 2.0f;
					WriteProcessMemory(hProcHandle, (LPVOID)temp42, &localPlayerStruct.pitch, sizeof(localPlayerStruct.pitch), NULL);
					WriteProcessMemory(hProcHandle, (LPVOID)temp43, &localPlayerStruct.yaw, sizeof(localPlayerStruct.yaw), NULL);
					
				}*/
			}
		}
	}

	// clean up DirectX and COM
	cleanD3D();
}
Exemple #25
0
void render_frame(void)
{


	d3ddev->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0, 0, 0, 0), 1.0f, 0);

	d3ddev->BeginScene();


	if (radar)
	{
		for (int i = 0; i < 64; i++)
		{
			int playerX = playersInfo[i].Position[0] - localPlayerStruct.Position[0];
			int playerY = playersInfo[i].Position[1] - localPlayerStruct.Position[1];

			float radarPosX = 116;
			float radarPosY = 150;

			if (localPlayerStruct.Position != playersInfo[i].Position)
			{
				if (playersInfo[i].teamNum == vLTeamNum && playersInfo[i].Health > 0 && playersInfo[i].Health <= 100 && playersInfo[i].lifeState != 0)
				{
					DrawRect((radarPosX + (playerX / RectSize)), (radarPosY + -(playerY / RectSize)), 5, 5, D3DCOLOR_ARGB(255, 0, 0, 255));
					
					if (WorldToScreen(playersInfo[i].Position, PlayerXY))
					{
						DrawESP(playersInfo[i].Health, PlayerXY[0] - m_Rect.left, PlayerXY[1] - m_Rect.top, Get3dDistance(localPlayerStruct.Position, playersInfo[i].Position), D3DCOLOR_XRGB(0, 0, 255));
					}
					
				}
				else if (playersInfo[i].teamNum != vLTeamNum && playersInfo[i].Health > 0 && playersInfo[i].Health <= 100 && playersInfo[i].lifeState != 0)
				{
					DrawRect((radarPosX + (playerX / RectSize)), (radarPosY + -(playerY / RectSize)), 5, 5, D3DCOLOR_ARGB(255, 0, 255, 0));
					if (WorldToScreen(playersInfo[i].Position, EnemyXY))
					{
						std::stringstream os;
						os << playersInfo[i].Health;
						DrawESP(playersInfo[i].Health, EnemyXY[0] - m_Rect.left, EnemyXY[1] - m_Rect.top, Get3dDistance(localPlayerStruct.Position, playersInfo[i].Position), D3DCOLOR_XRGB(255, 0, 0));
						DrawString(EnemyXY[0] - m_Rect.left, EnemyXY[1] - m_Rect.top, 12, D3DCOLOR_XRGB(255, 255, 0), pFont, (LPCSTR)os.str().c_str());
					}
					if (WorldToScreen(playersInfo[i].boneXYZ, BoneXY))
					{
						DrawRect(BoneXY[0], BoneXY[1], 5, 5, D3DCOLOR_XRGB(255, 0, 0));
					}
				}
			}
			

			//std::stringstream Test;
			//Test << playersInfo[i].vis ;

			

			//playersInfo[i].x = 0;
			//playersInfo[i].y = 0;
			//playersInfo[i].Health = 0;
			playersInfo[i].lifeState = 0;
		}
	}
	
	
	//DrawESP(ESPx, ESPy, ESPd, D3DCOLOR_XRGB(255, 255, 255));

	DrawBox((SCREEN_WIDTH / 2) - aimbotSize, (SCREEN_HEIGHT / 2) - aimbotSize, aimbotSize * 2, aimbotSize * 2, D3DCOLOR_XRGB(255, 0, 180));
	
	d3ddev->EndScene();

	d3ddev->Present(NULL, NULL, NULL, NULL);

}
Exemple #26
0
void CEntity::Read(int Index)
{
	Address = Process->ReadMemory<DWORD>(GlobalVariables::ClientAddress + Offsets::EntityList + (Index * 0x10));
	if (Address == NULL)
	{
		Valid = false;
		return;
	}
	Health = Process->ReadMemory<int>(Address + 0xFC);
	if (Health <= 0)
	{
		Valid = false;
		return;
	}
	LifeState = Process->ReadMemory<BYTE>(Address + 0x25B);
	if (LifeState != 0)
	{
		Valid = false;
		return;
	}
	Team = Process->ReadMemory<int>(Address + 0xF0);


	Valid = true;

	Position = Process->ReadMemory<Vector3D>(Address + 0x134);
	weaponHandle = Process->ReadMemory<DWORD>(Address + 0x12C0);
	weaponIDFirst = weaponHandle & 0xFFF;
	WeaponAddress = Process->ReadMemory<DWORD>(GlobalVariables::ClientAddress + Offsets::EntityList + ((weaponIDFirst - 1) * 0x10));
	WeaponID = Process->ReadMemory<int>(WeaponAddress + 0x0000168c);
	Clip1 = Process->ReadMemory<int>(WeaponAddress + 0x000015c0);
	//Clip2 = Process->ReadMemory<int>(WeaponAddress + 0x000015c4);
	ShotsFired = Process->ReadMemory<int>(Address + 0x00001d60);
	IsLocalPlayer = Process->ReadMemory<bool>(Address + 0x19c0);
	if (IsLocalPlayer)
	{
		Valid = false;
		LocalPlayer->weaponHandle = weaponHandle;
		LocalPlayer->weaponIDFirst = weaponIDFirst;
		LocalPlayer->WeaponAddress = WeaponAddress;
		LocalPlayer->WeaponID = WeaponID;
		LocalPlayer->Clip1 = Clip1;
		LocalPlayer->Clip2 = Clip2;
		LocalPlayer->ShotsFired = ShotsFired;
		return;
	}
	
	IsOnScreen = WorldToScreen(Position, PosOnScreen);
	PseudoHeadPosInGame = Vector3D{ Position.x, Position.y, Position.z + 70.0f };
	PseudoHeadIsOnScreen = WorldToScreen(PseudoHeadPosInGame, PseudoHeadPosOnScreen);
	if (!IsOnScreen && !PseudoHeadIsOnScreen && !IsLocalPlayer)
	{
		return;
	}
	Spotted = Process->ReadMemory<bool>(Address + 0x935);
	BoneAddress = Process->ReadMemory<DWORD>(Address + 0xA78);
	//MoveSpeed = Process->ReadMemory<float>(Address + 0xAD0);
	flags = Process->ReadMemory<int>(Address + 0x100);
	Velocity = Process->ReadMemory<Vector3D>(Address + 0x110);

	BoxHeight = PosOnScreen.y - PseudoHeadPosOnScreen.y;
	BoxWidth = BoxHeight*0.35;

	Box.left = PosOnScreen.x - BoxWidth/2;
	Box.top = PseudoHeadPosOnScreen.y;
	Box.right = PosOnScreen.x + BoxWidth/2;
	Box.bottom = PosOnScreen.y;


	Distance = Get3dDistance(Position, LocalPlayer->Position);

	if (BoneAddress != NULL)
	{
		ValidBones = true;
		ReadBonesMatrix();
		ReadBoneFromMatrix(10);
		ReadBoneFromMatrix(5);
		ReadBoneFromMatrix(4);
		ReadBoneFromMatrix(2);
		if (Get3dDistance(Position, Bone[2].PositionInGame) > 100)
			ValidBones = false;
	}
}
Exemple #27
0
void DrawX(UCanvas *pCanvas, FVector Location, FColor myCOLOR, float Scale) {
	if (!pPC) return;
	FVector TargetLocation2D = WorldToScreen(pCanvas, Location);
	pCanvas->Draw2DLine(TargetLocation2D.X - (8 * Scale), TargetLocation2D.Y - (8 * Scale),  TargetLocation2D.X + (8 * Scale),  TargetLocation2D.Y + (8 * Scale), myCOLOR);							
	pCanvas->Draw2DLine(TargetLocation2D.X + (8 * Scale), TargetLocation2D.Y - (8 * Scale),  TargetLocation2D.X - (8 * Scale),  TargetLocation2D.Y + (8 * Scale), myCOLOR);
}