- 120
- 5
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Есть airbrake,
Но к сожалению работает через жопу и кикает через раз, помогите пожалуйста, с синхронизацией
C++:
{
if (!g_Config.Player.bAirBreak)
return;
const float fCameraRotation = TheCamera.m_fOrientation;
const float fSpeed = g_Config.Player.fAirBreak / 10.f;
CVector* pPos = &FindPlayerPed()->m_matrix->pos;
FindPlayerPed()->m_fCurrentRotation = FindPlayerPed()->m_fAimingRotation = -fCameraRotation;
FindPlayerPed()->m_vecMoveSpeed.fZ = 0.f;
CVehicle* pVehicle = FindPlayerVehicle(-1, false);
if (pVehicle != nullptr)
{
pPos = &pVehicle->m_matrix->pos;
const float fLength = (pVehicle->m_matrix->pos - *pPos).Magnitude();
pVehicle->m_matrix->SetRotateZOnly(-fCameraRotation);
pVehicle->m_matrix->pos.fX = pPos->fX - sinf(fCameraRotation) * fLength;
pVehicle->m_matrix->pos.fY = pPos->fY - cosf(fCameraRotation) * fLength;
pVehicle->m_vecMoveSpeed.fX = pVehicle->m_vecMoveSpeed.fY = pVehicle->m_vecMoveSpeed.fZ = 0.f;
}
else FindPlayerPed()->m_nPedFlags.bIsStanding = FindPlayerPed()->m_nPedFlags.bWasStanding = FindPlayerPed()->m_nPedFlags.bStayInSamePlace = true;
if (ImGui::IsKeyDown('W'))
pPos->fX += sinf(fCameraRotation) * fSpeed, pPos->fY += cosf(fCameraRotation) * fSpeed;
if (ImGui::IsKeyDown('S'))
pPos->fX -= sinf(fCameraRotation) * fSpeed, pPos->fY -= cosf(fCameraRotation) * fSpeed;
if (ImGui::IsKeyDown('D'))
pPos->fX += cosf(fCameraRotation) * fSpeed, pPos->fY -= sinf(fCameraRotation) * fSpeed;
if (ImGui::IsKeyDown('A'))
pPos->fX -= cosf(fCameraRotation) * fSpeed, pPos->fY += sinf(fCameraRotation) * fSpeed;
if (ImGui::IsKeyDown(VK_SPACE))
pPos->fZ += fSpeed;
if (ImGui::IsKeyDown(VK_CONTROL))
pPos->fZ -= fSpeed;
}