get camera x,y,z position

DutchGay101

Active member
Joined
Sep 15, 2023
Messages
34
Reaction score
3
how do i get the player camera's x,y,z position ?
i tried
float camX = (float)(0x76F338);
float camY = (float)(0x76F33C);
float camZ = (float)(0x76F340);
didnt work
 

SIGKILL

Active member
Joined
Apr 29, 2020
Messages
40
Reaction score
24
Location
Earth
It doesn't work because you are essentially casting hex values (they are just integers) into floating point values. What you want to do is treat the hex values as memory addresses and read the value at the address like this:

C++:
float camX = *(float*)0x76F338;
float camY = *(float*)0x76F33C;
float camZ = *(float*)0x76F340;

Also, be sure your code is in the same memory space as the game (like a DLL that is hooked into the game process) otherwise you can not read this memory like described above.
 

DutchGay101

Active member
Joined
Sep 15, 2023
Messages
34
Reaction score
3
my code was correct i didnt put it in a Code Preview thats why it looked like that
 
Top