mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[saco] Implement/match CPlayerPed::GetTargetRotation()
This commit is contained in:
parent
caed517670
commit
195f63f62e
@ -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)
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
|
||||
WORD GetAmmo();
|
||||
|
||||
float GetTargetRotation();
|
||||
void GiveWeapon(int iWeaponID, int iAmmo);
|
||||
void SetArmedWeapon(int iWeaponType, bool bUnk);
|
||||
WEAPON_SLOT_TYPE * GetCurrentWeaponSlot();
|
||||
|
Loading…
Reference in New Issue
Block a user