mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-11 17:58:16 +08:00
[saco] Implement/match CPlayerPed::GetTargetRotation()
This commit is contained in:
1 parent
caed517670
commit
195f63f62e
2 files changed
+20
No files matched your search
@@ -260,6 +260,25 @@ BOOL CPlayerPed::IsInVehicle()
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
float CPlayerPed::GetTargetRotation()
|
||||
{
|
||||
if(!m_pPed) return 0.0f;
|
||||
if(GamePool_Ped_GetAt(m_dwGTAId) == 0) return 0.0f;
|
||||
|
||||
MATRIX4X4 mat;
|
||||
GetMatrix(&mat);
|
||||
|
||||
float fZAngle = atan2(-mat.up.X, mat.up.Y) * 180.0f / PI;
|
||||
// Bound it to [0, 360)
|
||||
if ( fZAngle < 0.0f )
|
||||
fZAngle += 360.0f;
|
||||
else if ( fZAngle >= 360.0f )
|
||||
fZAngle -= 360.0f;
|
||||
return fZAngle;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void CPlayerPed::GiveWeapon(int iWeaponID, int iAmmo)
|
||||
|
||||
Reference in new issue
Block a user