Advertisement
dcomicboy

Ghost Mode

Dec 2nd, 2011
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. cPlayerMgr* pPlayerManager;
  2. pPlayerManager= *(cPlayerMgr**)ADDR_PLAYERMANAGER;
  3. PlayerPitch = pPlayerManager->Pitch;
  4. PlayerYaw = pPlayerManager->Yaw;
  5. bool Forward = (GetAsyncKeyState('I') & 0x8000) != 0;
  6. bool Backward = (GetAsyncKeyState('K') & 0x8000) != 0;
  7. bool Left = (GetAsyncKeyState('J') & 0x8000) != 0;
  8. bool Right = (GetAsyncKeyState('L') & 0x8000) != 0;
  9.  
  10. if (Forward || Backward || Left || Right)
  11. {
  12. if (Forward || Backward)
  13. {
  14. float Sign = (Forward ? 1.0f : -1.0f);
  15. Posx += Sign * 20.0f * sinf(PlayerYaw);
  16. Posy += Sign * 20.0f * sinf(-PlayerPitch);
  17. Posz += Sign * 20.0f * cosf(PlayerYaw);
  18. }
  19. if (Left)
  20. {
  21. Posx += 20.0f * sinf(PlayerYaw - (MATH_PI / 2.0f));
  22. Posy += 0;
  23. Posz += 20.0f * cosf(PlayerYaw - (MATH_PI / 2.0f));
  24. }
  25. if (Right)
  26. {
  27. Posx += 20.0f * sinf(PlayerYaw + (MATH_PI / 2.0f));
  28. Posy += 0;
  29. Posz += 20.0f * cosf(PlayerYaw + (MATH_PI / 2.0f));
  30. }
  31. }
  32. engine->SetLocalPlayerPosition(D3DXVECTOR3(Posx, Posy, Posz));
  33.  
  34.  
  35.  
  36. *(float*)( dwClass + 0xC8 ) = Pos.x;
  37. *(float*)( dwClass + 0xCC ) = Pos.y;
  38. *(float*)( dwClass + 0xD0 ) = Pos.z;
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement