Kodlar Bunlar
bool DeltaEnable;
float MouseDeltaX = 0.0000f, MouseDeltaY = 0.0000f, MouseDeltaZ = 0.0000f;
_declspec (naked) void DeltaX()
{
if (DeltaEnable)
{
__asm
{
fld dword ptr[MouseDeltaX]
retn
}
}
else
__asm
{
fld dword ptr[ecx + 0x14]
retn
}
}
_declspec (naked) void DeltaY()
{
if (DeltaEnable)
{
__asm
{
fld dword ptr[MouseDeltaY]
retn
}
}
else
__asm
{
fld dword ptr[ecx + 0x18]
retn
}
}
int HookDelta = 0;
void InitDelta()
{
DWORD InputMouse = (DWORD)GetModuleHandleA("i3InputDx.dll");
int LocalX, LocalY, SetScreenCenterX, SetScreenCenterY, Priority, AimKey, BoneIndex = -1;
D3DXVECTOR3 OnWorld, OnScreen;
D3DVIEWPORT9 pViewer;
pDevice->GetViewport(&pViewer);
SetScreenCenterX = (pViewer.Width / 2.0f);
SetScreenCenterY = (pViewer.Height / 2.0f);
DWORD Player = *(DWORD*)g_pPlayer;
if((Player != 0x000000))
{
if(HookDelta == 0)
{
HookDelta = 1;
CreateDetour((DWORD)DeltaX,(DWORD)InputMouse + 0xA0AF0,Detour_Type_0xE9, 5); //A0AF0
CreateDetour((DWORD)DeltaY,(DWORD)InputMouse + 0xA0B00,Detour_Type_0xE9, 5);
}
Priority = GetNearestToCrosshair();
DeltaEnable = false;
if(Priority > -1)
{
if (cPlayer->GetBone2(Priority,7))
{
if (GetAsyncKeyState(VK_SHIFT))
DeltaEnable = true;
else
DeltaEnable = false;
if (WorldToDelta(OnWorld, OnScreen))
{
LocalX = OnScreen.x;
LocalY = OnScreen.y;
if (LocalX != SetScreenCenterX && LocalY != SetScreenCenterY)
{
MouseDeltaX = LocalX - SetScreenCenterX;
MouseDeltaY = LocalY - SetScreenCenterY;
}
else
{
MouseDeltaX = 0.00f;
MouseDeltaY = 0.00f;
}
}
}
}
}
}