Lua:
Citizen.CreateThread(function()
while true do
Citizen.Wait(1)
local ped = PlayerPedId()
if IsPedDoingDriveby(ped) then
SetFollowVehicleCamViewMode(4)
else
SetFollowVehicleCamViewMode(1)
end
end
end)