Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cPlayerMgr* pPlayerManager;
- pPlayerManager= *(cPlayerMgr**)ADDR_PLAYERMANAGER;
- PlayerPitch = pPlayerManager->Pitch;
- PlayerYaw = pPlayerManager->Yaw;
- bool Forward = (GetAsyncKeyState('I') & 0x8000) != 0;
- bool Backward = (GetAsyncKeyState('K') & 0x8000) != 0;
- bool Left = (GetAsyncKeyState('J') & 0x8000) != 0;
- bool Right = (GetAsyncKeyState('L') & 0x8000) != 0;
- if (Forward || Backward || Left || Right)
- {
- if (Forward || Backward)
- {
- float Sign = (Forward ? 1.0f : -1.0f);
- Posx += Sign * 20.0f * sinf(PlayerYaw);
- Posy += Sign * 20.0f * sinf(-PlayerPitch);
- Posz += Sign * 20.0f * cosf(PlayerYaw);
- }
- if (Left)
- {
- Posx += 20.0f * sinf(PlayerYaw - (MATH_PI / 2.0f));
- Posy += 0;
- Posz += 20.0f * cosf(PlayerYaw - (MATH_PI / 2.0f));
- }
- if (Right)
- {
- Posx += 20.0f * sinf(PlayerYaw + (MATH_PI / 2.0f));
- Posy += 0;
- Posz += 20.0f * cosf(PlayerYaw + (MATH_PI / 2.0f));
- }
- }
- engine->SetLocalPlayerPosition(D3DXVECTOR3(Posx, Posy, Posz));
- *(float*)( dwClass + 0xC8 ) = Pos.x;
- *(float*)( dwClass + 0xCC ) = Pos.y;
- *(float*)( dwClass + 0xD0 ) = Pos.z;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement