forked from Simnation/Main
ed
This commit is contained in:
parent
10a58f604e
commit
dd864f1ca5
1 changed files with 3 additions and 102 deletions
|
@ -329,7 +329,7 @@ RegisterNetEvent('taxi:enterStationVehicle', function(data)
|
||||||
|
|
||||||
-- Verschiedene Fahrer-Models versuchen
|
-- Verschiedene Fahrer-Models versuchen
|
||||||
local driverModels = {
|
local driverModels = {
|
||||||
"A_C_Chimp", -- Taxi Driver (erste Wahl)
|
"s_m_y_taxidriver_01", -- Taxi Driver (erste Wahl)
|
||||||
"a_m_y_business_01", -- Business Male
|
"a_m_y_business_01", -- Business Male
|
||||||
"a_m_m_business_01", -- Business Male 2
|
"a_m_m_business_01", -- Business Male 2
|
||||||
"mp_m_freemode_01", -- Male Freemode
|
"mp_m_freemode_01", -- Male Freemode
|
||||||
|
@ -706,10 +706,6 @@ function OpenStationTaxiMenu(stationId, vehicleId, vehicle, driver, pricePerKm)
|
||||||
lib.showContext('station_taxi_menu')
|
lib.showContext('station_taxi_menu')
|
||||||
end
|
end
|
||||||
|
|
||||||
function SelfDriveStationTaxi(stationId, vehicleId, vehicle)
|
|
||||||
print("^2[TAXI STATIONS DEBUG]^7 Player driving taxi themselves")
|
|
||||||
|
|
||||||
local playerPed = PlayerPedId()
|
|
||||||
function SelfDriveStationTaxi(stationId, vehicleId, vehicle)
|
function SelfDriveStationTaxi(stationId, vehicleId, vehicle)
|
||||||
print("^2[TAXI STATIONS DEBUG]^7 Player driving taxi themselves")
|
print("^2[TAXI STATIONS DEBUG]^7 Player driving taxi themselves")
|
||||||
|
|
||||||
|
@ -896,9 +892,9 @@ function StartStationTaxiRide(stationId, vehicleId, vehicle, driver, destination
|
||||||
|
|
||||||
stuckCounter = 0
|
stuckCounter = 0
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
stuckCounter = math.max(0, stuckCounter - 1)
|
stuckCounter = math.max(0, stuckCounter - 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Überprüfen ob die Fahrt zu lange dauert
|
-- Überprüfen ob die Fahrt zu lange dauert
|
||||||
if GetGameTimer() > rideTimeout then
|
if GetGameTimer() > rideTimeout then
|
||||||
|
@ -1223,69 +1219,6 @@ function EndStationTaxiRide(stationId, vehicleId, vehicle, driver)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Thread zum Überwachen der Tasten im Stations-Taxi
|
|
||||||
CreateThread(function()
|
|
||||||
while true do
|
|
||||||
Wait(0)
|
|
||||||
|
|
||||||
local playerPed = PlayerPedId()
|
|
||||||
local inStationTaxi = false
|
|
||||||
local currentStationTaxi = nil
|
|
||||||
local currentStationId = nil
|
|
||||||
local currentVehicleId = nil
|
|
||||||
local currentDriver = nil
|
|
||||||
local pricePerKm = 0
|
|
||||||
|
|
||||||
-- Prüfen ob Spieler in einem Stations-Taxi sitzt
|
|
||||||
for stationId, vehicles in pairs(stationVehicles) do
|
|
||||||
for vehicleId, vehicleInfo in pairs(vehicles) do
|
|
||||||
if vehicleInfo.entity and DoesEntityExist(vehicleInfo.entity) and vehicleInfo.occupied then
|
|
||||||
if IsPedInVehicle(playerPed, vehicleInfo.entity, false) then
|
|
||||||
inStationTaxi = true
|
|
||||||
currentStationTaxi = vehicleInfo.entity
|
|
||||||
currentStationId = stationId
|
|
||||||
currentVehicleId = vehicleId
|
|
||||||
currentDriver = vehicleInfo.driver
|
|
||||||
pricePerKm = vehicleInfo.data.pricePerKm
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if inStationTaxi then break end
|
|
||||||
end
|
|
||||||
|
|
||||||
if inStationTaxi and currentStationTaxi then
|
|
||||||
-- Zeige Hinweise an
|
|
||||||
local helpText = '[E] - Ziel wählen [F] - Fahrt beenden'
|
|
||||||
lib.showTextUI(helpText, {
|
|
||||||
position = "top-center",
|
|
||||||
icon = 'taxi',
|
|
||||||
style = {
|
|
||||||
borderRadius = 10,
|
|
||||||
backgroundColor = '#48BB78',
|
|
||||||
color = 'white'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Wenn E gedrückt wird, öffne Menü
|
|
||||||
if IsControlJustReleased(0, 38) then -- E Taste
|
|
||||||
OpenStationTaxiMenu(currentStationId, currentVehicleId, currentStationTaxi, currentDriver, pricePerKm)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Wenn F gedrückt wird, beende Fahrt
|
|
||||||
if IsControlJustReleased(0, 23) then -- F Taste
|
|
||||||
lib.hideTextUI()
|
|
||||||
EndStationTaxiRide(currentStationId, currentVehicleId, currentStationTaxi, currentDriver)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
-- Nicht in einem Stations-Taxi
|
|
||||||
lib.hideTextUI()
|
|
||||||
Wait(1000)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
|
|
||||||
-- Cleanup beim Resource Stop
|
-- Cleanup beim Resource Stop
|
||||||
AddEventHandler('onResourceStop', function(resourceName)
|
AddEventHandler('onResourceStop', function(resourceName)
|
||||||
if GetCurrentResourceName() == resourceName then
|
if GetCurrentResourceName() == resourceName then
|
||||||
|
@ -1316,35 +1249,3 @@ AddEventHandler('onResourceStop', function(resourceName)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Cleanup beim Resource Stop
|
|
||||||
AddEventHandler('onResourceStop', function(resourceName)
|
|
||||||
if GetCurrentResourceName() == resourceName then
|
|
||||||
print("^2[TAXI STATIONS DEBUG]^7 Cleaning up stations...")
|
|
||||||
|
|
||||||
-- TextUI verstecken falls noch angezeigt
|
|
||||||
lib.hideTextUI()
|
|
||||||
|
|
||||||
-- Alle Station-Fahrzeuge löschen
|
|
||||||
for stationId, vehicles in pairs(stationVehicles) do
|
|
||||||
for vehicleId, vehicleInfo in pairs(vehicles) do
|
|
||||||
if vehicleInfo.entity and DoesEntityExist(vehicleInfo.entity) then
|
|
||||||
exports['qb-target']:RemoveTargetEntity(vehicleInfo.entity)
|
|
||||||
DeleteEntity(vehicleInfo.entity)
|
|
||||||
end
|
|
||||||
if vehicleInfo.driver and DoesEntityExist(vehicleInfo.driver) then
|
|
||||||
DeleteEntity(vehicleInfo.driver)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Alle Blips entfernen
|
|
||||||
for _, blip in pairs(stationBlips) do
|
|
||||||
RemoveBlip(blip)
|
|
||||||
end
|
|
||||||
|
|
||||||
print("^2[TAXI STATIONS DEBUG]^7 Cleanup completed")
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue