| View previous topic :: View next topic |
| Author |
Message |
ChippingCoder How do I cheat?
Reputation: 0
Joined: 06 May 2016 Posts: 4
|
Posted: Sat May 07, 2016 8:47 pm Post subject: Trying to obtain coordinates in front of player (use of cam) |
|
|
Alright so I'm trying to get the coordinates in front of my character using Y (vertical) and X (horizontal) camera rotation/direction values so that I can use it for something like noclip.
Here's what I was using before, this requires a Z axis, so it doesn't work.
| Code: | float camRot[2];
ReadProcessMemory(hProcess, (void *)0xCE65D8, &camRot, 8, NULL);
float tX, tZ, num;
tZ = camRot[1] * 0.0174532924f;
tX = camRot[0] * 0.0174532924f;
num = abs(cos(tX));
float dir[3];
dir[0] = (-sin(tZ)) * num;
dir[1] = (cos(tZ)) * num;
dir[2] = sin(tX);
dir[0] *= 50;
dir[1] *= 50;
dir[2] *= 50;
WriteProcessMemory(hProcess, (void *)0x21D89CC0, &dir, 12, NULL); |
|
|
| Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sat May 07, 2016 9:52 pm Post subject: |
|
|
| What do you mean by noclip? |
|
| Back to top |
|
 |
ChippingCoder How do I cheat?
Reputation: 0
Joined: 06 May 2016 Posts: 4
|
Posted: Sat May 07, 2016 10:43 pm Post subject: |
|
|
| ++METHOS wrote: | | What do you mean by noclip? |
Sort of like this
youtube(dot)com/watch?v=cbo0g8m61rQ
or like this
youtu(dot)be/dsYsv18y54k?t=1m37s
... these are just examples |
|
| Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sun May 08, 2016 9:57 am Post subject: |
|
|
| ChippingCoder wrote: | | so that I can use it for something like noclip. | -What are you wanting to do, exactly? Why are you working with the camera functions? |
|
| Back to top |
|
 |
jcrueger How do I cheat?
Reputation: 0
Joined: 08 May 2016 Posts: 2
|
Posted: Sun May 08, 2016 9:57 pm Post subject: |
|
|
Looks like to make this work you need the players current z axis if these formulas are correct. It should work something like this:
GetPlayers current z axis;
GetCameraY axis; <-- y is up and down x is left and right
without the players z axis there is no way to calculate how high to fly. |
|
| Back to top |
|
 |
|