diff --git a/saco/game/playerped.cpp b/saco/game/playerped.cpp index 7bb2f80..62a183a 100644 --- a/saco/game/playerped.cpp +++ b/saco/game/playerped.cpp @@ -290,6 +290,19 @@ void CPlayerPed::SetTargetRotation(float fRotation) m_pPed->fRotation1 = DegToRad(fRotation); } +//----------------------------------------------------------- + +void CPlayerPed::ForceTargetRotation(float fRotation) +{ + if(!m_pPed) return; + if(!GamePool_Ped_GetAt(m_dwGTAId)) return; + + m_pPed->fRotation1 = DegToRad(fRotation); + m_pPed->fRotation2 = DegToRad(fRotation); + + ScriptCommand(&set_actor_z_angle,m_dwGTAId,fRotation); +} + //----------------------------------------------------------- void CPlayerPed::GiveWeapon(int iWeaponID, int iAmmo) diff --git a/saco/game/playerped.h b/saco/game/playerped.h index 30eb028..3a9b84a 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -43,6 +43,8 @@ public: float GetTargetRotation(); void SetTargetRotation(float fRotation); + void ForceTargetRotation(float fRotation); + void GiveWeapon(int iWeaponID, int iAmmo); void SetArmedWeapon(int iWeaponType, bool bUnk); WEAPON_SLOT_TYPE * GetCurrentWeaponSlot(); diff --git a/saco/game/scripting.h b/saco/game/scripting.h index a5ab1ce..6a52998 100644 --- a/saco/game/scripting.h +++ b/saco/game/scripting.h @@ -68,6 +68,7 @@ const SCRIPT_COMMAND enable_train_traffic = { 0x06d7, "i" }; const SCRIPT_COMMAND put_train_at = { 0x07c7, "ifff" }; const SCRIPT_COMMAND get_active_interior = { 0x077e, "v" }; +const SCRIPT_COMMAND set_actor_z_angle = { 0x0173, "if" }; const SCRIPT_COMMAND refresh_streaming_at = { 0x04E4, "ff" };