From 9ac72cc0f76fd12df955213261297aff55fe7f99 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Fri, 20 Sep 2024 23:45:30 +0800 Subject: [PATCH] [server] Implement/match `n_GetPlayerVehicleID(...)` --- server/scrcustom.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/scrcustom.cpp b/server/scrcustom.cpp index 352b358..8313269 100644 --- a/server/scrcustom.cpp +++ b/server/scrcustom.cpp @@ -934,9 +934,15 @@ static cell AMX_NATIVE_CALL n_GetPlayerColor(AMX *amx, cell *params) return 0; } +// native GetPlayerVehicleID(playerid) static cell AMX_NATIVE_CALL n_GetPlayerVehicleID(AMX *amx, cell *params) { - // TODO: GetPlayerVehicleID + CPlayerPool *pPlayerPool = pNetGame->GetPlayerPool(); + if(!pPlayerPool) return 0; + CPlayer *pPlayer = pNetGame->GetPlayerPool()->GetAt((PLAYERID)params[1]); + if(pPlayer) { + return pPlayer->m_VehicleID; + } return 0; }