From 5be383d8babe69210b123493958dceefc6e0fe42 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Tue, 17 Sep 2024 11:14:41 +0800 Subject: [PATCH] [server] Implement/match `n_GetPlayerInterior(...)` --- server/player.h | 2 +- server/scrcustom.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/server/player.h b/server/player.h index fca3ade..9101282 100644 --- a/server/player.h +++ b/server/player.h @@ -171,7 +171,7 @@ public: int field_2C34; BOOL m_bCheckpointEnabled; BOOL m_bRaceCheckpointEnabled; - int field_2C40; + int m_iInteriorId; // Weapon data DWORD m_dwSlotAmmo[13]; diff --git a/server/scrcustom.cpp b/server/scrcustom.cpp index ef3a93b..b09370f 100644 --- a/server/scrcustom.cpp +++ b/server/scrcustom.cpp @@ -1052,9 +1052,14 @@ static cell AMX_NATIVE_CALL n_SetPlayerInterior(AMX *amx, cell *params) return 0; } +// native GetPlayerInterior(playerid,interiorid) static cell AMX_NATIVE_CALL n_GetPlayerInterior(AMX *amx, cell *params) { - // TODO: GetPlayerInterior + CPlayer *pPlayer = pNetGame->GetPlayerPool()->GetAt((PLAYERID)params[1]); + if (pPlayer) + { + return pPlayer->m_iInteriorId; + } return 0; }