From 9209bc4a02e6f58d2e64e82562dfd6c539a60dd7 Mon Sep 17 00:00:00 2001 From: Serius41 <118758994+Serius41@users.noreply.github.com> Date: Fri, 5 Sep 2025 11:20:11 +0300 Subject: [PATCH 1/2] Update CLuaPedDefs.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit isPedInVehicle was returning true on the server side even if the ped was not in the vehicle. Here we had to check if there was a groove in the vehicle, and the values ​​were returning differently between the client and server. --- Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp b/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp index ba2f6c1b926..c4a524305aa 100644 --- a/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp +++ b/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp @@ -781,7 +781,9 @@ int CLuaPedDefs::IsPedInVehicle(lua_State* luaVM) if (!argStream.HasErrors()) { - lua_pushboolean(luaVM, CStaticFunctionDefinitions::GetPedOccupiedVehicle(pPed) != NULL); + CVehicle* pVehicle = CStaticFunctionDefinitions::GetPedOccupiedVehicle(pPed); + bool bInVehicle = (pVehicle != NULL) && (pPed->GetVehicleAction() == CPed::VEHICLEACTION_NONE); + lua_pushboolean(luaVM, bInVehicle); return 1; } else From 45127eddaf2abe365820a166b3155e1aaf7186f4 Mon Sep 17 00:00:00 2001 From: Serius41 <118758994+Serius41@users.noreply.github.com> Date: Fri, 5 Sep 2025 18:30:40 +0300 Subject: [PATCH 2/2] Fix IsPedInVehicle synchronization issue between server and client Fixed --- Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp b/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp index c4a524305aa..750e11f314c 100644 --- a/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp +++ b/Server/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp @@ -781,9 +781,9 @@ int CLuaPedDefs::IsPedInVehicle(lua_State* luaVM) if (!argStream.HasErrors()) { - CVehicle* pVehicle = CStaticFunctionDefinitions::GetPedOccupiedVehicle(pPed); - bool bInVehicle = (pVehicle != NULL) && (pPed->GetVehicleAction() == CPed::VEHICLEACTION_NONE); - lua_pushboolean(luaVM, bInVehicle); + CVehicle* vehicle = CStaticFunctionDefinitions::GetPedOccupiedVehicle(pPed); + bool inVehicle = vehicle && pPed->GetVehicleAction() == CPed::VEHICLEACTION_NONE; + lua_pushboolean(luaVM, inVehicle); return 1; } else