ESP doesnt draw a Box
Hey guys, i drawed a box when WorldToScreen() function... in the top left corner of cs go... At first i want to draw a box of all Player but it doesnt work, theres no box, only the top left one...
My Offsets are right btw
There could maybe be a syntax error cuz C&P
Thx in advance !
My Offsets are right btw
Code:
void ESP()
{
DWORD dwClient = Mem.Module("client.dll");
DWORD dwEngine = Mem.Module("engine.dll");
ReadProcessMemory(pHandle, (LPVOID)(dwClient + ViewMatrix), &W2S_M.flMatrix, sizeof(WorldToScreenMatrix_t), NULL);
GetWindowRect(FindWindow(NULL, "Counter-Strike: Global Offensive"), &m_Rect);
DWORD pLocal = Mem.Read<DWORD>(dwClient + dw_PlayerBase);
//int LocalTeam = Mem.Read<int>(pLocal + dw_teamOffset);
DWORD LocalTeam = ReadProcessMemory(pHandle, (LPVOID)(dw_PlayerBase + 0xF0), &LocalTeam, sizeof(LocalTeam), NULL);
int LocalHealth = Mem.Read<int>(pLocal + dw_healthOffset);
float LocalPosition[3];
LocalPosition[0] = Mem.Read<float>(pLocal + 0x134);
LocalPosition[1] = Mem.Read<float>(pLocal + 0x138);
LocalPosition[2] = Mem.Read<float>(pLocal + 0x13C);
for (int i = 0; i < 32; i++)
{
uintptr_t pEnemy = Mem.Read<uintptr_t>(dwClient + dw_EntityBase + (i * dw_EntityLoopDistance));
int EnemyTeam = ReadProcessMemory(pHandle, (LPVOID)(dw_EntityBase + 0xF0), &EnemyTeam, sizeof(EnemyTeam), NULL);
int EnemyHealth = Mem.Read<int>(pEnemy + dw_healthOffset);
float HeadPos[3];
float Position[3];
Position[0] = Mem.Read<float>(pEnemy + 0x134);
Position[1] = Mem.Read<float>(pEnemy + 0x138);
Position[2] = Mem.Read<float>(pEnemy + 0x13C);
uintptr_t BoneBase = Mem.Read<uintptr_t>(pEnemy + dw_BoneMatrix);
GetBonePos(BoneBase, 6, HeadPos);
float EnemyXYHeadPos[3];
float EnemyXY[3];
if (WorldToScreen(Position, EnemyXY) && WorldToScreen(HeadPos, EnemyXYHeadPos))
{
float Distance = Get3dDistance(LocalPosition, Position);
float Height = abs(EnemyXY[1] - EnemyXYHeadPos[1]);
float Width = Height / 2;
DrawBox(10, 10, 20, 20, 1, 255, 0, 0, 255);
DrawBox(EnemyXY[0] - (Width / 2), EnemyXY[1] - Height, Width, Height, 1, 255, 0, 0, 255);
}
}
Thx in advance !

