Advertisement
Guest User

Get Vehicle Pos

a guest
Sep 23rd, 2013
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <Windows.h>
  3. #include <iostream>
  4.  
  5. #define CVehicle 0xB6F980
  6.  
  7. using namespace std;
  8.  
  9. int _tmain(int argc, _TCHAR* argv[])
  10. {
  11.     HWND sampWindow = FindWindow(0, _T("GTA:SA:MP"));
  12.     HANDLE hProcess;
  13.     DWORD PID, CVehicleAddress;
  14.     float output;
  15.  
  16.     if(!sampWindow)
  17.     {
  18.         cout << "SA:MP IS CLOSED!\n";
  19.         cin.get();
  20.         return true;
  21.     }
  22.     else cout << "SA:MP IS OPEN!\n";
  23.  
  24.     GetWindowThreadProcessId(sampWindow, &PID);
  25.     hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, PID);
  26.     if(!hProcess) cout << "Cannot open process!";
  27.    
  28.     ReadProcessMemory(hProcess, (void *) CVehicle, &CVehicleAddress, sizeof(CVehicleAddress), NULL);
  29.     ReadProcessMemory(hProcess, (byte *) CVehicleAddress +??????, &output, sizeof(output), NULL);
  30.     cout << "Your fPosZ: " << (float) output << "\n";
  31.     CloseHandle(hProcess);
  32.     cin.get();
  33.     return true;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement