Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "Engine.h"
- #define _LTClientShell 0x166FCE0
- INT Cabeca, Nuca, OmbroD, ObroE, CotoveloD, CotoveloE, MaoD, MaoE, Peito = 1, Saco, JoelhoD, JoelhoE, PeD, PeE;
- int AutoFire, Visivelmente, iAimFov, smmooth;
- DWORD Aimkey;
- bool inGame()
- {
- DWORD CShell = (DWORD)GetModuleHandleA("CShell.dll");
- //DWORD pLTClientShell = *(DWORD*)(CShell + dw_pLTClientShell);
- DWORD pLTClientShell = *(DWORD*)(CShell + _LTClientShell);
- cPlayer* player = GetPlayerByIndex(pLTClientShell, GetMyIndex(pLTClientShell));
- if ((player != NULL) && (strlen(player->Name) > 2) && (player->Object != NULL))
- return true;
- return false;
- }
- bool IsValidClientAim(cPlayer* Clients)
- {
- if ((Clients != 0)
- && (Clients->Health != 0)
- && (strlen(Clients->Name))
- && ((Clients->Object != NULL)))
- return true;
- return false;
- }
- //bool isValidClientAim(CPlayer* Clients)
- //{
- // if ((Clients != NULL) && (Clients->Health > 0) && (strlen(Clients->Name) > 2) && (Clients->Object != NULL))
- // return true;
- // return false;
- //}
- D3DTLVERTEX CreateD3DTLVERTEX(float X, float Y, float Z, float RHW, D3DCOLOR color, float U, float V) {
- D3DTLVERTEX v = { X, Y, Z, RHW, color };
- return v;
- }
- void DrawCircle(int x, int y, float radius, D3DCOLOR color, IDirect3DDevice9* pDevice)
- {
- const DWORD D3D_FVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1;
- const int NUMPOINTS = 30;
- const float PI = (float)3.141592654f;
- D3DTLVERTEX Circle[NUMPOINTS + 1];
- float X, Y, Theta, WedgeAngle;
- WedgeAngle = (float)((2 * PI) / NUMPOINTS);
- for (int i = 0; i <= NUMPOINTS; i++)
- {
- Theta = i * WedgeAngle;
- X = (float)(x + radius * cos(Theta));
- Y = (float)(y - radius * sin(Theta));
- Circle[i] = CreateD3DTLVERTEX(X, Y, 0.0f, 1.0f, color, 0.0f, 0.0f);
- }
- pDevice->SetRenderState(D3DRS_ZENABLE, 0);
- pDevice->SetRenderState(D3DRS_FOGENABLE, false);
- pDevice->SetRenderState(D3DRS_LIGHTING, false);
- pDevice->SetRenderState(D3DRS_ALPHATESTENABLE, true);
- pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, true);
- pDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL);
- pDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
- pDevice->SetFVF(D3D_FVF);
- pDevice->SetTexture(0, NULL);
- pDevice->DrawPrimitiveUP(D3DPT_LINESTRIP, NUMPOINTS, &Circle[0], sizeof(Circle[0]));
- pDevice->SetTexture(0, NULL);
- }
- int AimbotPosition;
- int Aimbot;
- bool LMOUSE;
- INT iFov;
- INT AimFov;
- INT CriarFovAimbot;
- void PlayerAimbot(LPDIRECT3DDEVICE9 pDevice)
- {
- DWORD CShell = (DWORD)GetModuleHandleA("CShell.dll");
- DWORD ClientFX = (DWORD)GetModuleHandleA("ClientFx.fxd");
- if (CShell != NULL && ClientFX != NULL)
- {
- DWORD pCLTPlayerClient = *(DWORD*)(CShell + aCLTPlayerClient + PlayerClientOffset);
- if (pCLTPlayerClient && inGame() && Aimbot)
- {
- int TargetIndex, BONE_ID;
- BONE_ID = 6;//HEAD
- switch (AimbotPosition)
- {
- case 1: BONE_ID = 6; break;//Head
- case 2: BONE_ID = 5; break;//Neck
- case 3: BONE_ID = 2; break;//Body
- case 4: BONE_ID = 10; break;//LeftHand
- case 5: BONE_ID = 17; break;//RightHand
- case 6: BONE_ID = 23; break;//FeftFoot
- case 7: BONE_ID = 28; break;//RightFoot
- default: BONE_ID = 6;//HEAD
- }
- int iAimAt = -1;
- float MaxDistance = 0xFFFFFFF;
- D3DVIEWPORT9 viewP;
- pDevice->GetViewport(&viewP);
- float ScreenX = viewP.Width / 2;
- float ScreenY = viewP.Height / 2;
- DWORD pLTClientShell = *(DWORD*)(CShell + _LTClientShell);
- cPlayer* Me = GetPlayerByIndex(pLTClientShell, GetMyIndex(pLTClientShell));
- if (pLTClientShell != NULL)
- {
- for (int i = 0; i < 16; i++)
- {
- cPlayer* pPlayer = GetPlayerByIndex(pLTClientShell, i);
- D3DXVECTOR3 pos = GetBonePosition(pPlayer->Object, 6);
- if (Trans3DTo2D(pDevice, &pos))
- {
- POINT pt;
- D3DVIEWPORT9 Viewport;
- pDevice->GetViewport(&Viewport);
- DWORD x1 = Viewport.Width / 2;
- DWORD y1 = Viewport.Height / 2;
- pt.x = x1;
- pt.y = y1;
- if (iAimFov)
- {
- if (iFov == 0)
- AimFov = 10.0f;
- else if (iFov == 1)
- AimFov = 30.0f;
- else if (iFov == 2)
- AimFov = 60.0f;
- else if (iFov == 3)
- AimFov = 90.0f;
- else if (iFov == 4)
- AimFov = 120.0f;
- else if (iFov == 5)
- AimFov = 180.0f;
- else if (iFov == 6)
- AimFov = 360.0f;
- }
- if (CriarFovAimbot)
- {
- int PI222 = 6.283185307179586;
- POINT pt;
- D3DVIEWPORT9 Viewport;
- pDevice->GetViewport(&Viewport);
- DWORD posx = Viewport.Width / 2;
- DWORD posy = Viewport.Height / 2;
- pt.x = posx;
- pt.y = posy;
- DrawCircle(pt.x - 1, pt.y, iFov * PI222, D3DCOLOR_ARGB(255, 000, 000, 000), pDevice);
- DrawCircle(pt.x, pt.y, iFov * PI222, D3DCOLOR_ARGB(255, 000, 255, 000), pDevice);
- }
- float radiusx = (AimFov * 5.0f) * (ScreenX / 100.0f);
- float radiusy = (AimFov * 5.0f) * (ScreenY / 100.0f);
- if (AimFov == 0)
- {
- radiusx = 5.0f * (ScreenX / 100.0f);
- radiusy = 5.0f * (ScreenY / 100.0f);
- }
- float Tmp = GetDistance(pos.x, pos.y, ScreenX, ScreenY);
- //if in fov
- if (pos.x >= ScreenX - radiusx && pos.x <= ScreenX + radiusx && pos.y >= ScreenY - radiusy && pos.y <= ScreenY + radiusy)
- {
- if (Tmp < MaxDistance)
- {
- MaxDistance = Tmp;
- iAimAt = i;
- }
- }
- }
- }
- if (iAimAt == -1)
- return;
- if (iAimAt > -1)
- {
- cPlayer* Target = GetPlayerByIndex(pLTClientShell, iAimAt);
- D3DXVECTOR3 AimPos = GetBonePosition(Target->Object, BONE_ID);
- if (Visivelmente && IsVisible(GetBonePosition(Me->Object, BONE_ID), GetBonePosition(Target->Object, BONE_ID)))
- {
- if (Target != Me && !IsTM(pLTClientShell, Target) && IsValidClientAim(Target))
- {
- if (Trans3DTo2D(pDevice, &AimPos))
- {
- float DistX = AimPos.x - ScreenX;
- float DistY = AimPos.y - ScreenY;
- int aimsens = 5;
- DistX /= (0.5f + (float)aimsens * 0.5f);
- DistY /= (0.5f + (float)aimsens * 0.5f);
- if (LMOUSE)
- {
- Aimkey = VK_LBUTTON;
- }
- if (GetAsyncKeyState(Aimkey))
- {
- mouse_event(MOUSEEVENTF_MOVE, (float)DistX, (float)DistY, 0, NULL);
- }
- if (AutoFire)
- {
- mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
- mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
- }
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement