- 46
- 7
При инжекте я просто начинаю бегать по кругу, самп перестает реагировать на нажатие каких-либо клавиш.
C++:
float* coordinates = (*(DWORD*)0xB6F5F0) ? (float*)(*(DWORD*)(*(DWORD*)0xB6F5F0 + 0x14) + 0x30) : NULL;
DWORD Gravity = *(DWORD*)0x863984;
WNDPROC Wnd = NULL;
bool CheatOn = false;
LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_KEYUP:
{
switch (wParam)
{
case VK_RSHIFT:
{
if (CheatOn == false)
CheatOn = true;
else
CheatOn = false;
}
case VK_UP:
CheatOn == true ? coordinates[2] += 0.001f : NULL;
case VK_DOWN:
CheatOn == true ? coordinates[2] -= 0.001f : NULL;
case VK_LEFT:
CheatOn == true ? coordinates[0] -= 0.001f : NULL;
case VK_RIGHT:
CheatOn == true ? coordinates[0] += 0.001f : NULL;
case 0x57:
CheatOn == true ? coordinates[1] += 0.001f : NULL;
case 0x53:
CheatOn == true ? coordinates[1] -= 0.001f : NULL;
break;
}
}
}
return CallWindowProcA(WNDPROC(Wnd), hwnd, uMsg, wParam, lParam);
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
{
Wnd = (WNDPROC)SetWindowLong(FindWindowA(0, "GTA:SA:MP"), GWL_WNDPROC, (LONG)WndProc);
}
}
return TRUE;
}