Jump to content

[SA] C++ Get position


Armyw0w

Recommended Posts

Hi i have a problem with geting position at Player.

 

i have this:

 

 

        DWORD* pActor = (DWORD*)0xB6F5F0;        DWORD* pMtrx1 = (DWORD*)((*pActor) + 0x14);        float* xPos1 = (float*)((*pMtrx1) + 0x30);

 

But my DLL get crash because are pointers at pActor, if i delete pointers at pActor the DLL is injected but xPos1 is 0.0 (i tested in a loop)

 

can help me, please ?

Link to comment
Share on other sites

char output[64];

float *position = (*(DWORD *)0xB6F5F0)? (float *)(*(DWORD *)(*(DWORD *)0xB6F5F0 + 0x14) + 0x30) : NULL;

if(position)

sprintf(output, "x %f y %f z %f", position[0], position[1], position[2]);

Edited by _DK
Link to comment
Share on other sites


 

 

struct CVector

{

float x;

float y;

float z;

};

 

char output[64];

CVector *position = (*(DWORD *)0xB6F5F0)? (CVector *)(*(DWORD *)(*(DWORD *)0xB6F5F0 + 0x14) + 0x30) : NULL;

if(position)

sprintf(output, "x %f y %f z %f", position -> x, position -> y, position -> z);

Edited by fastman92
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.