Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int setup=0;
- DWORD CShell_LiM;
- int* GameStatus;
- std::string FormatString(std::string one, std::string two, std::string three) {
- return std::string(one+=two+=three);
- };
- int GetD3DTextWidth(LPD3DXFONT pFont, std::string szText) {
- RECT rcRect = {0,0,0,0};
- if (pFont) {
- pFont->DrawText(NULL, szText.c_str(), strlen(szText.c_str()), &rcRect, DT_CALCRECT, D3DCOLOR_ARGB(0,0, 0, 0));
- }
- return rcRect.right - rcRect.left;
- };
- void DrawD3DText(LPD3DXFONT pFont, int x, int y, int z, D3DCOLOR color, std::string szText) {
- RECT rct;
- rct.left=x;
- rct.right=z;
- rct.top=y;
- rct.bottom=rct.top+200;
- pFont->DrawText(NULL, szText.c_str(), -1, &rct, DT_CENTER, color);
- };
- struct D3DTLVERTEX
- {
- float x, y, z, rhw;
- DWORD color;
- };
- void DrawD3DLine (LPDIRECT3DDEVICE9 pDevice, float X, float Y, float X2, float Y2, DWORD dwColor)
- {
- D3DTLVERTEX qV[2] =
- {
- {(float)X, (float)Y, 0.0f, 1.0f, dwColor},
- {(float)X2, (float)Y2, 0.0f, 1.0f, dwColor},
- };
- pDevice->SetFVF(D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_TEX1);
- pDevice->DrawPrimitiveUP(D3DPT_LINELIST, 1, qV, sizeof(D3DTLVERTEX));
- }
- void espme(LPDIRECT3DDEVICE9 pDevice) {
- if(setup==0){
- CShell_LiM = reinterpret_cast<DWORD>(GetModuleHandle("CShell.dll"));
- GameStatus = reinterpret_cast<int*>(CShell_LiM + GameStatus_Address);
- setup=1;
- };
- if ((GameStatus != NULL) && *GameStatus == 11) {
- DWORD ltclientshell = *reinterpret_cast<DWORD*>(CShell_LiM + 0x11F7F34);
- CPlayer* LocalPlayer = reinterpret_cast<CPlayer*>(GetPlayerByIndex(ltclientshell, GetMyIndex(ltclientshell)));
- for (int Key = 0; (Key <= 15); Key++) {
- CPlayer* Player = reinterpret_cast<CPlayer*>(GetPlayerByIndex(ltclientshell, Key));
- if (isValidClient(Player) && (Player != LocalPlayer)) {
- D3DXVECTOR3 PlayerBody = GetBonePosition((Player -> Object), 2);
- WorldToScreen(pDevice, &PlayerBody);
- D3DCOLOR ESPColor = (((LocalPlayer -> Team) == (Player -> Team)) ? D3DCOLOR_ARGB(255, 0, 255, 0) : D3DCOLOR_ARGB(255, 255, 0, 0));
- std::string PlayerName = FormatString("[", (Player -> Name), "]");
- int PlayerName_Width = GetD3DTextWidth(pFont, PlayerName);
- DrawD3DText(pFont, (PlayerBody.x - (PlayerName_Width / 2)), (PlayerBody.y - 45), PlayerName_Width, ESPColor, PlayerName);
- char* health;
- itoa(Player->Health, health, 10);
- std::string PlayerHealth = FormatString("[Health: ", health, "]");
- int PlayerHealth_Width = GetD3DTextWidth(pFont, PlayerHealth);
- DrawD3DText(pFont, (PlayerBody.x - (PlayerHealth_Width / 2)), (PlayerBody.y + 35), PlayerHealth_Width, ESPColor, PlayerHealth);
- DrawD3DLine(pDevice, (GetSystemMetrics(SM_CXSCREEN) / 2), 0, PlayerBody.x, PlayerBody.y, ESPColor);
- };
- };
- };//
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement