From b7b3ee511b13e2f116c090814a990b58cc993a8b Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Tue, 17 Sep 2024 11:16:39 +0800 Subject: [PATCH] [server] Implement/match `n_IsPlayerInRaceCheckpoint(...)` --- server/player.h | 3 +++ server/scrcustom.cpp | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/server/player.h b/server/player.h index 9101282..44fba12 100644 --- a/server/player.h +++ b/server/player.h @@ -207,6 +207,9 @@ public: void ToggleCheckpoint(BOOL bEnabled); void SetRaceCheckpoint(int iType, float fX, float fY, float fZ, float fNX, float fNY, float fNZ, float fSize); void ToggleRaceCheckpoint(BOOL bEnabled); + + BOOL IsInRaceCheckpoint() { return m_bInRaceCheckpoint; }; + }; //---------------------------------------------------- diff --git a/server/scrcustom.cpp b/server/scrcustom.cpp index b09370f..fe59a6f 100644 --- a/server/scrcustom.cpp +++ b/server/scrcustom.cpp @@ -1042,7 +1042,11 @@ static cell AMX_NATIVE_CALL n_DisablePlayerRaceCheckpoint(AMX *amx, cell *params static cell AMX_NATIVE_CALL n_IsPlayerInRaceCheckpoint(AMX *amx, cell *params) { - // TODO: IsPlayerInRaceCheckpoint + CPlayer *pPlayer = pNetGame->GetPlayerPool()->GetAt((PLAYERID)params[1]); + if (pPlayer) + { + return pPlayer->IsInRaceCheckpoint(); + } return 0; }