From a64870c79a5131b778f7f0b081775bb5929b62af Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Tue, 17 Sep 2024 11:17:30 +0800 Subject: [PATCH] [server] Implement/match `n_IsPlayerInCheckpoint(...)` --- server/player.h | 1 + server/scrcustom.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/server/player.h b/server/player.h index 44fba12..dbd5327 100644 --- a/server/player.h +++ b/server/player.h @@ -208,6 +208,7 @@ public: void SetRaceCheckpoint(int iType, float fX, float fY, float fZ, float fNX, float fNY, float fNZ, float fSize); void ToggleRaceCheckpoint(BOOL bEnabled); + BOOL IsInCheckpoint() { return m_bInCheckpoint; }; BOOL IsInRaceCheckpoint() { return m_bInRaceCheckpoint; }; }; diff --git a/server/scrcustom.cpp b/server/scrcustom.cpp index fe59a6f..2941626 100644 --- a/server/scrcustom.cpp +++ b/server/scrcustom.cpp @@ -1009,7 +1009,11 @@ static cell AMX_NATIVE_CALL n_DisablePlayerCheckpoint(AMX *amx, cell *params) static cell AMX_NATIVE_CALL n_IsPlayerInCheckpoint(AMX *amx, cell *params) { - // TODO: IsPlayerInCheckpoint + CPlayer *pPlayer = pNetGame->GetPlayerPool()->GetAt((PLAYERID)params[1]); + if (pPlayer) + { + return pPlayer->IsInCheckpoint(); + } return 0; }