From 3227dd0905012a972b60c57b605f2da848558520 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:52:24 +0800 Subject: [PATCH] [saco] Implement/match `CPlayerPed::RemoveFromVehicleAndPutAt(...)` --- saco/game/playerped.cpp | 11 +++++++++++ saco/game/playerped.h | 2 ++ saco/game/scripting.h | 1 + 3 files changed, 14 insertions(+) diff --git a/saco/game/playerped.cpp b/saco/game/playerped.cpp index 8e90f8e..3c5450d 100644 --- a/saco/game/playerped.cpp +++ b/saco/game/playerped.cpp @@ -766,6 +766,17 @@ int CPlayerPed::GetVehicleSeatID() return (-1); } +//----------------------------------------------------------- +// Forceful removal + +void CPlayerPed::RemoveFromVehicleAndPutAt(float fX, float fY, float fZ) +{ + if(!GamePool_Ped_GetAt(m_dwGTAId)) return; + if(m_pPed && IN_VEHICLE(m_pPed)) { + ScriptCommand(&remove_actor_from_car_and_put_at,m_dwGTAId,fX,fY,fZ); + } +} + //----------------------------------------------------------- WORD CPlayerPed::GetAmmo() diff --git a/saco/game/playerped.h b/saco/game/playerped.h index 1f32bf4..b8d9ce5 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -65,6 +65,8 @@ public: void SetImmunities(BOOL bBullet, BOOL bFire, BOOL bExplosion, BOOL bDamage, BOOL bUnknown); + void RemoveFromVehicleAndPutAt(float fX, float fY, float fZ); + BOOL IsAPassenger(); VEHICLE_TYPE * GetGtaVehicle(); diff --git a/saco/game/scripting.h b/saco/game/scripting.h index f6aac63..0fd8255 100644 --- a/saco/game/scripting.h +++ b/saco/game/scripting.h @@ -68,6 +68,7 @@ const SCRIPT_COMMAND set_actor_can_be_decapitated = { 0x0446, "ii" }; const SCRIPT_COMMAND play_sound = { 0x018c, "fffi" }; +const SCRIPT_COMMAND remove_actor_from_car_and_put_at = { 0x0362, "ifff" }; const SCRIPT_COMMAND enable_train_traffic = { 0x06d7, "i" }; const SCRIPT_COMMAND lock_car = { 0x0519, "ii" };