1
0
Fork 0
forked from Simnation/Main

Update main.lua

This commit is contained in:
Nordi98 2025-07-30 06:03:41 +02:00
parent f16f396bee
commit 3b2d052eba

View file

@ -453,7 +453,7 @@ function NavigateToPlayer(driver, taxi, playerCoords)
-- Fahrer-Verhalten verbessern
SetDriverAggressiveness(driver, 0.0)
SetDriverAbility(driver, 1.0)
}
end
function MonitorTaxiProgress(taxi, driver, playerCoords)
print("^2[TAXI DEBUG]^7 Monitoring taxi progress...")
@ -552,7 +552,8 @@ function RecoverStuckTaxi(taxi, driver, playerCoords)
print("^3[TAXI DEBUG]^7 Using direct approach for recovery")
TaskVehicleDriveToCoordLongrange(driver, taxi, playerCoords.x, playerCoords.y, playerCoords.z, 25.0, 786603, 5.0)
end
}
end
function MonitorTaxiArrival(taxi, driver, playerCoords)
print("^2[TAXI DEBUG]^7 Monitoring taxi arrival...")
@ -620,6 +621,7 @@ function MonitorTaxiArrival(taxi, driver, playerCoords)
end
-- Event für Einsteigen ins Taxi
RegisterNetEvent('taxi:enterTaxi', function()
print("^2[TAXI DEBUG]^7 Player entering taxi")
@ -823,7 +825,8 @@ function NavigateToDestination(driver, taxi, destination)
-- Fahrer-Verhalten verbessern
SetDriverAggressiveness(driver, 0.0)
SetDriverAbility(driver, 1.0)
}
end
function MonitorTaxiRide(destination, price)
print("^2[TAXI DEBUG]^7 Monitoring taxi ride...")
@ -909,13 +912,15 @@ function MonitorTaxiRide(destination, price)
-- Neues Timeout setzen (1 Minute)
rideTimeout = GetGameTimer() + (60 * 1000)
}
end
lastPos = taxiCoords
Wait(2000)
end
end)
}
end
function SelfDriveTaxi()
print("^2[TAXI DEBUG]^7 Player driving taxi themselves")
@ -940,7 +945,8 @@ function SelfDriveTaxi()
description = 'Du fährst das Taxi jetzt selbst. Nutze /stoptaxi um es zu beenden.',
type = 'info'
})
}
end
function ExitTaxi()
print("^2[TAXI DEBUG]^7 Player exiting taxi")
@ -962,7 +968,8 @@ function ExitTaxi()
SetTimeout(5000, function()
DespawnTaxi()
end)
}
end
function DespawnTaxi()
print("^2[TAXI DEBUG]^7 Despawning taxi")
@ -1046,12 +1053,13 @@ function DespawnTaxi()
print("^2[TAXI DEBUG]^7 Taxi despawn completed (no driver)")
end
}
end
function CalculateDistanceToCoords(coords)
local playerCoords = GetEntityCoords(PlayerPedId())
return #(playerCoords - coords)
}
end
-- Command um Taxi zu stoppen
RegisterCommand('stoptaxi', function()
@ -1148,7 +1156,8 @@ function EndTaxiRide()
DespawnTaxi()
end)
end)
}
end
-- Thread zum Überwachen des Einsteigens ins Taxi (ohne qb-target)
CreateThread(function()