Hi,

I'm trying to change a pointer externally that I found in cheat engine for the game escape from tarkov, but when I write to it nothing changes. I'm not sure what isn't correct in the code.

I'm using this to find the right pointer, and that seems to work since everytime I restart the game it is able to find it & when changing the value it works in-game.
gyazo . com/0999cb6490e5002c6547dbff75b93d41.png

Since there are alot of offsets I think I did something wrong with those, here's my code:
Code:
#include <iostream>
#include <Windows.h>
 
using namespace std;
 
DWORD processID;
 
DWORD Location_Y = 0x0142A868; //basepointer
 
DWORD offset5 = 0x6d4;
DWORD offset4 = 0x4e8;
DWORD offset3 = 0x7a8;
DWORD offset2 = 0xe0;
DWORD offset1 = 0x220;
DWORD pAddress1;
DWORD pAddress2;
DWORD pAddress3;
DWORD pAddress4;
DWORD pAddress5;
 
float Y = 3.0f;
 
int main()
{
	HWND hwnd = FindWindowA(0, ("EscapeFromTarkov"));
	GetWindowThreadProcessId(hwnd, &processID);
 
	HANDLE pHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, processID);
 
	DWORD dwPointer;
	ReadProcessMemory(pHandle, (LPVOID)Location_Y, &dwPointer, 4, 0);
 
	ReadProcessMemory(pHandle, (void*)(Location_Y), &pAddress1, sizeof(pAddress1), 0);
	ReadProcessMemory(pHandle, (void*)(pAddress1 + offset1), &pAddress2, sizeof(pAddress2), 0);
	ReadProcessMemory(pHandle, (void*)(pAddress2 + offset2), &pAddress3, sizeof(pAddress3), 0);
	ReadProcessMemory(pHandle, (void*)(pAddress3 + offset3), &pAddress4, sizeof(pAddress4), 0);
	ReadProcessMemory(pHandle, (void*)(pAddress4 + offset4), &pAddress5, sizeof(pAddress5), 0);
 
	//Random tries, both don't work
	WriteProcessMemory(pHandle, (void*)(pAddress5 + offset5), &Y, sizeof(Y), 0);
	WriteProcessMemory(pHandle, (LPVOID)(dwPointer), &Y, sizeof(Y), 0);
	WriteProcessMemory(pHandle, (void*)(Location_Y + offset1 + offset2 + offset3 + offset4 + offset5), &Y, sizeof(Y), 0);
 
	system("pause");
}