[CODE lang="cpp" title="C++ esp"]float GetDistance(float Xx, float Yy, float xX, float yY)
{
return sqrt((yY - Yy) * (yY - Yy) + (xX - Xx) * (xX - Xx));
}
D3DVIEWPORT9 viewport;
LPD3DXLINE Line1;
void DrawLine2(LPDIRECT3DDEVICE9 pDev, int fromX, int fromY, int toX, int toY, DWORD Color)
{
if (!Line1)
D3DXCreateLine(pDev, &Line1);
static D3DXVECTOR2 Line[2];
Line[0].x = fromX;
Line[0].y = fromY;
Line[1].x = toX;
Line[1].y = toY;
Line1->Begin();
Line1->Draw(Line, 2, Color);
Line1->End();
}
D3DXVECTOR3 GetMidPoint(D3DXVECTOR3 V1, D3DXVECTOR3 V2)
{
D3DXVECTOR3 Mid;
Mid.x = (V1.x + V2.x) / 2;
Mid.y = (V1.y + V2.y) / 2;
Mid.z = (V1.z + V2.z) / 2;
return Mid;
}
bool w2s(LPDIRECT3DDEVICE9 pDevice, D3DXVECTOR3* InOut)
{
D3DXVECTOR3 vScreen;
D3DXVECTOR3 PlayerPos(InOut->x, InOut->y, InOut->z);
D3DVIEWPORT9 viewPort = { 0 };
D3DXMATRIX projection, view, world;
pDevice->GetTransform(D3DTS_VIEW, &view);
pDevice->GetTransform(D3DTS_PROJECTION, &projection);
pDevice->GetTransform(D3DTS_WORLD, &world);
pDevice->GetViewport(&viewPort);
D3DXVec3Project(&vScreen, &PlayerPos, &viewPort, &projection, &view, &world);
if (vScreen.z < 1)
{
*InOut = vScreen;
return true;
}
return false;
}
void Draw3DCricle(LPDIRECT3DDEVICE9 pDevice, D3DXVECTOR3 RootPos, float radius) {
const int segments = 9;
D3DXVECTOR2 screenPos[segments];
bool isVisible = true;
for (int i = 0; i < segments; ++i) {
float angle = (i * 2.0f * 3.14159f) / segments;
D3DXVECTOR3 circlePoint = {
RootPos.x + radius * cos(angle),
RootPos.y + radius * sin(angle),
RootPos.z
};
if (w2s(pDevice, &circlePoint)) {
screenPos
= D3DXVECTOR2(circlePoint.x, circlePoint.y);
}
else {
isVisible = false;
}
}
if (!isVisible) return;
DWORD circleColor = D3DCOLOR_ARGB(255, 255, 255, 255);
for (int i = 0; i < segments - 1; ++i) {
DrawLine2(pDevice, (int)screenPos.x, (int)screenPos.y, (int)screenPos[i + 1].x, (int)screenPos[i + 1].y, circleColor);
}
DrawLine2(pDevice, (int)screenPos[segments - 1].x, (int)screenPos[segments - 1].y, (int)screenPos[0].x, (int)screenPos[0].y, circleColor);
}
void rangewait(LPDIRECT3DDEVICE9 pDevice, float x, float y, float z, DWORD Color, int xz)
{
D3DXVECTOR3 pos = { x ,y, z };
Draw3DCricle(pDevice, pos, python::C_WairRangeValue);
}[/CODE]
[CODE lang="cpp" title="kullanım"] DWORD color = D3DCOLOR_ARGB(255, 255, 0, 0);int xz = 30;
rangewait(pDevice, c_players.x, c_players.y, c_players.z, color, xz);[/CODE]
Basittir zaten çalısır