Guest User

Ayam77

a guest
Feb 2nd, 2018
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. #include <windows.h>
  2. #include <iostream>
  3. void Ayam77();
  4.  
  5. BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
  6. {
  7. if (dwReason == DLL_PROCESS_ATTACH) {
  8. DisableThreadLibraryCalls(hModule); //disables attach and detach notifications
  9. CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)Ayam77, NULL, NULL, NULL); //creates a new thread and starts at function mainHack()
  10. }
  11. else if (dwReason == DLL_PROCESS_DETACH) {
  12.  
  13. }
  14.  
  15. return TRUE;
  16. }
  17.  
  18. void Ayam77() {
  19. D3DXMATRIX viewmatrix = m_Scene->m_pToViewMatrix->m_pViewMatrix;
  20.  
  21. D3DXVECTOR3 direction = D3DXVECTOR3(viewmatrix._11, viewmatrix._21, viewmatrix._31);
  22.  
  23.  
  24. if (GetAsyncKeyState(VK_RIGHT))
  25. {
  26. D3DXVECTOR3 direction = GetRight(&viewmatrix);
  27.  
  28. pLocalPlayer->m_Position.x += direction.x * 2;
  29. pLocalPlayer->m_Position.y += direction.y * 2;
  30. pLocalPlayer->m_Position.z += direction.z * 2;
  31. }
  32.  
  33. if (GetAsyncKeyState(VK_LEFT))
  34. {
  35. D3DXVECTOR3 direction = GetRight(&viewmatrix);
  36. direction *= -1;
  37.  
  38. pLocalPlayer->m_Position.x += direction.x * 2;
  39. pLocalPlayer->m_Position.y += direction.y * 2;
  40. pLocalPlayer->m_Position.z += direction.z * 2;
  41. }
  42.  
  43. if (GetAsyncKeyState(VK_UP))
  44. {
  45. D3DXVECTOR3 direction = GetForward(&viewmatrix);
  46.  
  47. pLocalPlayer->m_Position.x += direction.x * 2;
  48. pLocalPlayer->m_Position.y += direction.y * 2;
  49. pLocalPlayer->m_Position.z += direction.z * 2;
  50. }
  51.  
  52. if (GetAsyncKeyState(VK_DOWN))
  53. {
  54. D3DXVECTOR3 direction = GetForward(&viewmatrix);
  55. direction *= -1;
  56.  
  57. pLocalPlayer->m_Position.x += direction.x * 2;
  58. pLocalPlayer->m_Position.y += direction.y * 2;
  59. pLocalPlayer->m_Position.z += direction.z * 2;
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment