From ab853af4c21d9fc6d58302da908ca680200af808 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:45:42 +0800 Subject: [PATCH] [saco] Implement/match `CPlayerPed::GetVehicleSeatID()` --- saco/game/playerped.cpp | 20 ++++++++++++++++++++ saco/game/playerped.h | 1 + 2 files changed, 21 insertions(+) diff --git a/saco/game/playerped.cpp b/saco/game/playerped.cpp index dc0d0a3..8e90f8e 100644 --- a/saco/game/playerped.cpp +++ b/saco/game/playerped.cpp @@ -748,6 +748,26 @@ float CPlayerPed::GetDistanceFromVehicle(CVehicle *pVehicle) //----------------------------------------------------------- +int CPlayerPed::GetVehicleSeatID() +{ + VEHICLE_TYPE *pVehicle; + + if( GetActionTrigger() == ACTION_INCAR && (pVehicle = (VEHICLE_TYPE *)m_pPed->pVehicle) != 0 ) { + if(pVehicle->pDriver == m_pPed) return 0; + if(pVehicle->pPassengers[0] == m_pPed) return 1; + if(pVehicle->pPassengers[1] == m_pPed) return 2; + if(pVehicle->pPassengers[2] == m_pPed) return 3; + if(pVehicle->pPassengers[3] == m_pPed) return 4; + if(pVehicle->pPassengers[4] == m_pPed) return 5; + if(pVehicle->pPassengers[5] == m_pPed) return 6; + if(pVehicle->pPassengers[6] == m_pPed) return 7; + } + + return (-1); +} + +//----------------------------------------------------------- + WORD CPlayerPed::GetAmmo() { if(m_pPed) { diff --git a/saco/game/playerped.h b/saco/game/playerped.h index 501bc40..1f32bf4 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -71,6 +71,7 @@ public: VEHICLE_TYPE * GetGtaContactVehicle(); ENTITY_TYPE * GetGtaContactEntity(); + int GetVehicleSeatID(); float GetDistanceFromVehicle(CVehicle *pVehicle); void StartJetpack();