Hi all i'm trying to make a teleport function in my hack (realy d3d...)
this is the my code, where is the error?? because when i click pageup for teleport i go to the cordinate 0 0 0, i think the readpointerfloat function don't work
this is the code of functions:
Code:
void WritePointerFloat(long addy, short offset, float value) //////this work
{
long maddy;
long saddy;
memory();
ReadProcessMemory(hProcess, (LPVOID*)(DWORD) addy, &maddy, sizeof(maddy), NULL);
saddy = maddy + offset;
WriteProcessMemory(hProcess, (LPVOID*)(DWORD) saddy, &value, sizeof(value), NULL);
}
void ReadPointerFloat(long addy, short offset, float &buffer) ////// this i think no
{
long faddy;
long raddy;
memory();
ReadProcessMemory(hProcess,(LPVOID*)(DWORD)addy, &faddy, sizeof(faddy),NULL);
raddy = faddy + offset;
ReadProcessMemory(hProcess,(LPVOID*)(DWORD)raddy, &buffer, sizeof(buffer),NULL);
}
this is the code of teleport:
Code:
void teleport()
{
float x, y, z;
if (GetAsyncKeyState(VK_NEXT) &1<< 0xF)
{
ReadPointerFloat(pointer_Addie, 0x174, y);
ReadPointerFloat(pointer_Addie, 0x17C, x);
ReadPointerFloat(pointer_Addie, 0x178, z);
}
if (GetAsyncKeyState(VK_PRIOR) &1<< 0xF)
{
WritePointerFloat(pointer_Addie, 0x174, y);
WritePointerFloat(pointer_Addie, 0x17C, x);
WritePointerFloat(pointer_Addie, 0x178, z);
}
}
where is the error ??
thx for helping!