feat(sync): add code for triggering sync on entering a vehicle

This commit is contained in:
Dan
2021-03-04 20:39:27 +00:00
parent 914c6a28aa
commit 4f5902ff19

View File

@@ -92,3 +92,22 @@ Citizen.CreateThread( function()
Citizen.Wait( 500 )
end
end )
Citizen.CreateThread( function()
while ( true ) do
if ( IsPedGettingIntoAVehicle( PLY.ped ) ) then
UTIL:Notify( "DEBUG: Player getting in vehicle" )
local vehEntering = GetVehiclePedIsEntering( PLY.ped )
Citizen.Wait( 2000 )
local veh = GetVehiclePedIsIn( PLY.ped, false )
if ( veh == vehEntering ) then
UTIL:Notify( "DEBUG: Trigger sync" )
end
end
Citizen.Wait( 500 )
end
end )