Просмотр полной версии : how to get a player position without lag compensation
Tentei algumas maneiras, mas não tive sucesso. Gostaria de ajuda com isso. Desculpe se escrevi na seção errada, não sou da Rússia.
Tentei algumas maneiras, mas não tive sucesso. Gostaria de ajuda com isso. Desculpe se escrevi na seção errada, não sou da Rússia.
C++:
sampapi::CVector getLocalPosition() {
sampapi::CVector pos{0, 0, 0};
auto pNetGame = sampapi::v037r3::RefNetGame();
if (!pNetGame) return pos;
auto pPlayerPool = pNetGame->GetPlayerPool();
if (!pPlayerPool) return pos;
auto pLocalPlayer = pPlayerPool->GetLocalPlayer();
if (!pLocalPlayer) return pos;
pos.x = pLocalPlayer->m_onfootData.m_position.x;
pos.y = pLocalPlayer->m_onfootData.m_position.y;
pos.z = pLocalPlayer->m_onfootData.m_position.z;
return pos;
}
or without sampapi
C++:
CVector getLocalPlayerPositionRaw()
{
void* pPlayerPed = *reinterpret_cast(0xB6F5F0);
if (!pPlayerPed)
return { 0,0,0 };
void* pMatrix = *reinterpret_cast(
reinterpret_cast(pPlayerPed) + 0x14
);
if (!pMatrix)
return { 0,0,0 };
const CVector pos = *reinterpret_cast(
reinterpret_cast(pMatrix) + 0x30
);
return pos;
}
C++:
sampapi::CVector getLocalPosition() {
sampapi::CVector pos{0, 0, 0};
auto pNetGame = sampapi::v037r3::RefNetGame();
if (!pNetGame) return pos;
auto pPlayerPool = pNetGame->GetPlayerPool();
if (!pPlayerPool) return pos;
auto pLocalPlayer = pPlayerPool->GetLocalPlayer();
if (!pLocalPlayer) return pos;
pos.x = pLocalPlayer->m_onfootData.m_position.x;
pos.y = pLocalPlayer->m_onfootData.m_position.y;
pos.z = pLocalPlayer->m_onfootData.m_position.z;
return pos;
}
or without sampapi
C++:
CVector getLocalPlayerPositionRaw()
{
void* pPlayerPed = *reinterpret_cast(0xB6F5F0);
if (!pPlayerPed)
return { 0,0,0 };
void* pMatrix = *reinterpret_cast(
reinterpret_cast(pPlayerPed) + 0x14
);
if (!pMatrix)
return { 0,0,0 };
const CVector pos = *reinterpret_cast(
reinterpret_cast(pMatrix) + 0x30
);
return pos;
}
This gives the player's position, not their position without lag compensation.I need to get a player's lag position to perform a lagshot esp.
vBulletin® v3.8.14, Copyright ©2000-2026, vBulletin Solutions, Inc. Перевод: zCarot