Why does this dont work?

Posts 1–12 of 12 · Page 1 of 1
Why does this dont work?
Code:
WORD dwPlayerPtr = *(DWORD*)Addr_Playerpointer;
if(dwPlayerPtr != 0)
{
     
    float PositionY; float PositionX;float PositionZ;
	PositionX = *(float*)(dwPlayerPtr + Ofs_X);
	PositionY = *(float*)(dwPlayerPtr + Ofs_Y);
	PositionZ = *(float*)(dwPlayerPtr + Ofs_Z);
    
  if(GetAsyncKeyState(VK_F10)&1)
  {
	  float Telx = PositionX; 
	  float Tely = PositionY; 
	  float Telz = PositionZ;
  if(GetAsyncKeyState(VK_F11)&1)
  {
		*(float*)(dwPlayerPtr + Ofs_X) = Telx;
		*(float*)(dwPlayerPtr + Ofs_Y) = Tely;
		*(float*)(dwPlayerPtr + Ofs_Z) = Telz;
  }
I tryed much things for teleport but dont get it to work. One time it did work but it gived debug error that the (Telx,Tely,Telz ) dont have value or something like that I had to press 3 times ignore and then it worked.
Why is that?
Skulhead you can better stop and learn something so u understand what you do.

ps: als je dat niet doet mensen gaan je niet blijven helpen met dingen. en wat shit leren is je enige optie om ooit wat te kunnen coden.
So, declar you variables on the top of your prog :

Code:
#define ...
float PositionY, PositionX, PositionZ;

// Start hacks
if(dwPlayerPtr != 0)
{
     
//
}
Then remove these 3 lines :
Code:
PositionX = *(float*)(dwPlayerPtr + Ofs_X);
PositionY = *(float*)(dwPlayerPtr + Ofs_Y);
PositionZ = *(float*)(dwPlayerPtr + Ofs_Z);
And replace theses one
Code:
float Telx = PositionX; 
 float Tely = PositionY; 
 float Telz = PositionZ;
This should look like this :

Code:
// declare variables
float PositionY, PositionX, PositionZ;

//Start hacks
DWORD dwPlayerPtr = *(DWORD*)Addr_Playerpointer;
if(dwPlayerPtr != 0)
{

  if(GetAsyncKeyState(VK_F10)&1)
  {
// We take the position only when pressing F10
	PositionX = *(float*)(dwPlayerPtr + Ofs_X);
	PositionY = *(float*)(dwPlayerPtr + Ofs_Y);
	PositionZ = *(float*)(dwPlayerPtr + Ofs_Z);
 }
    
  if(GetAsyncKeyState(VK_F11)&1)
  {
// The playerPosition will be the one we took before
		*(float*)(dwPlayerPtr + Ofs_X) = PositionX;
		*(float*)(dwPlayerPtr + Ofs_Y) = PositionY;
		*(float*)(dwPlayerPtr + Ofs_Z) = PositionZ;
  }
}
In your code, the player position were always checked. So, TelePOS = ActualPOS ( in fact, in your code ). So you pressed F11, you player didn't move.

This should work now
Yeah, ty! Great help

It gives debug error but when I press ignore it works. :S
What errors does it gives ?
Only warning no ?
When I am ingame it gives warning, but it works when I press ignore.
Ok so don't care about it ^^
Yeah but can I change settings in compiler to get this away?
Hmm

You are compiling in Release Mode ? Or Debug Mode?

( And, I realise, i didn't understand xhat you mean By "ingame it gives me warning" How should the dll give you warning ? )
It gives debug error.
Posts 1–12 of 12 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Talk with us