QuestionHelpHelp with c++ get player location!

Posts 14 of 4 · Page 1 of 1
Help with c++ get player location!
Hi, im not very good using c++ but want make online plugin when preamates playing h1z1. Only what i need simple c++ source code which geting my x,y cordiantes and print out in console ( cout << x << "," << y endl; ) can someone help me?

After i ll get i ll make online teamup programm using GameMaker + DLL with ur code, game maker i use for interface!

Just found this but its not working can someone can help to fix?

#include "stdafx.h"
#include "windows.h"
#include <iostream>
#include <cstdint>

using namespace std;

int main()
{
// attach to game window //
HWND hwnd = FindWindow(L"H1Z1 PlayClient (Live)", NULL);
if (!hwnd)
{
cout << "Window not found!" << endl;
cin.get();
exit(0);
}

// get process id of game //
DWORD pid;
GetWindowThreadProcessId(hwnd, &pid);

// get a handle of game //
HANDLE hGame = OpenProcess(PROCESS_VM_READ, 0, pid);
if (!hGame)
{
cout << "Unable to get handle!" << endl;
cin.get();
exit(0);
}

//define offsets
INT64 gameOffset = 0x142AEC018;
INT64 graphicOffset = 0x142AEBD68;

// start loop //
while (true)
{
INT64 entityOffset;
ReadProcessMemory(hGame, (void*)gameOffset, &entityOffset, sizeof(entityOffset), NULL);
/*INT64 playerOffset;
ReadProcessMemory(hGame, (void*)(entityOffset + 0x11D8), &playerOffset, sizeof(playerOffset), NULL);
INT64 positionOffset;
ReadProcessMemory(hGame, (void*)(playerOffset + 0x198), &positionOffset, sizeof(positionOffset), NULL);
float playerX;
ReadProcessMemory(hGame, (void*)(playerOffset + 0x110), &playerX, sizeof(playerX), NULL);
cout << gameOffset << " " << entityOffset << " " << playerOffset << " " << playerX << " " << sizeof(playerX) << endl;*/
cout << entityOffset << endl;
Sleep(20);
}

return 0;
}
/loc in game literally gives not only your exact coordinates but also the direction you are facing lmao
U are just retard man!
Quote Originally Posted by kulers View Post
U are just retard man!
It's Retarded, you retarded idiot.
Posts 14 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?