From 5c6af25c4082b33b587d53dc6fb8dba71a61f141 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Fri, 20 Sep 2024 23:54:47 +0800 Subject: [PATCH] [server] Implemen/match `n_RemovePlayerFromVehicle(...)` --- server/scrcustom.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/scrcustom.cpp b/server/scrcustom.cpp index a804d0b..a2ce642 100644 --- a/server/scrcustom.cpp +++ b/server/scrcustom.cpp @@ -996,10 +996,16 @@ static cell AMX_NATIVE_CALL n_PutPlayerInVehicle(AMX *amx, cell *params) return 0; } +// native RemovePlayerFromVehicle(playerid) static cell AMX_NATIVE_CALL n_RemovePlayerFromVehicle(AMX *amx, cell *params) { - // TODO: RemovePlayerFromVehicle - return 0; + RakNet::BitStream bsParams; + CPlayerPool *pPlayerPool = pNetGame->GetPlayerPool(); + if(!pPlayerPool || !pPlayerPool->GetSlotState((PLAYERID)params[1])) return 0; + + pNetGame->SendToPlayer(RPC_ScrRemovePlayerFromVehicle, &bsParams, (PLAYERID)params[1], 2); + + return 1; } // native IsPlayerInVehicle(playerid, vehicleid)