#include <iostream>
#include <Windows.h>
int main()
{
HWND hGTAWindow = FindWindow(NULL, L"GTA:SA:MP");
DWORD pId;
GetWindowThreadProcessId(hGTAWindow, &pId);
HANDLE hGTA = OpenProcess(PROCESS_VM_READ, TRUE, pId);
DWORD plPtr;
float plHealth;
while (true)
{
ReadProcessMemory(hGTA, (LPCVOID)0xB6F5F0, &plPtr, sizeof plPtr, NULL);
ReadProcessMemory(hGTA, (LPCVOID)(plPtr + 0x540), &plHealth, sizeof plHealth, NULL);
std::cout << "plHealth " << plHealth << std::endl;
Sleep(1000);
}
CloseHandle(hGTA);
return 0;
}