1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-07-30 03:12:57 +02:00
parent 6344067f37
commit 9b1bab8e9c
2 changed files with 72 additions and 7 deletions

View file

@ -174,7 +174,8 @@ RegisterNetEvent('taxi:enterStationVehicle', function(data)
SetVehicleDoorsLocked(vehicle, 1)
-- Info-Text anzeigen während Fahrer geladen wird
lib.showTextUI('🚕 Fahrer wird geladen, bitte warten...', {
print("^2[TAXI STATIONS DEBUG]^7 Showing driver loading text...")
lib.showTextUI('🚕 Warte an der Station - Fahrer wird geladen...', {
position = "top-center",
icon = 'taxi',
style = {
@ -184,6 +185,9 @@ RegisterNetEvent('taxi:enterStationVehicle', function(data)
}
})
-- Kurz warten damit der Text sichtbar wird
Wait(1000)
-- Verschiedene Fahrer-Models versuchen
local driverModels = {
"a_m_m_taxi_01",
@ -200,6 +204,17 @@ RegisterNetEvent('taxi:enterStationVehicle', function(data)
print("^2[TAXI STATIONS DEBUG]^7 Trying driver model: " .. modelName)
driverHash = GetHashKey(modelName)
-- Text während Model-Loading aktualisieren
lib.showTextUI('🚕 Lade Fahrer-Model: ' .. modelName .. '...', {
position = "top-center",
icon = 'taxi',
style = {
borderRadius = 10,
backgroundColor = '#48BB78',
color = 'white'
}
})
RequestModel(driverHash)
local timeout = GetGameTimer() + 5000
while not HasModelLoaded(driverHash) and GetGameTimer() < timeout do
@ -210,6 +225,17 @@ RegisterNetEvent('taxi:enterStationVehicle', function(data)
if HasModelLoaded(driverHash) then
print("^2[TAXI STATIONS DEBUG]^7 Driver model " .. modelName .. " loaded successfully")
-- Text aktualisieren
lib.showTextUI('🚕 Erstelle Fahrer...', {
position = "top-center",
icon = 'taxi',
style = {
borderRadius = 10,
backgroundColor = '#48BB78',
color = 'white'
}
})
driver = CreatePedInsideVehicle(vehicle, 26, driverHash, -1, true, false)
if DoesEntityExist(driver) then
@ -222,12 +248,24 @@ RegisterNetEvent('taxi:enterStationVehicle', function(data)
else
print("^1[TAXI STATIONS DEBUG]^7 Failed to load driver model: " .. modelName)
end
Wait(500) -- Kurze Pause zwischen Versuchen
end
-- Fallback: Fahrer ohne Model erstellen
if not driver or not DoesEntityExist(driver) then
print("^3[TAXI STATIONS DEBUG]^7 Using fallback driver creation...")
lib.showTextUI('🚕 Lade Standard-Fahrer...', {
position = "top-center",
icon = 'taxi',
style = {
borderRadius = 10,
backgroundColor = '#FFA500',
color = 'white'
}
})
-- Standard Male Model verwenden
driverHash = GetHashKey("mp_m_freemode_01")
RequestModel(driverHash)
@ -240,14 +278,27 @@ RegisterNetEvent('taxi:enterStationVehicle', function(data)
driver = CreatePedInsideVehicle(vehicle, 26, driverHash, -1, true, false)
print("^2[TAXI STATIONS DEBUG]^7 Fallback driver created: " .. (driver or "nil"))
end
Wait(1000) -- Länger warten für Fallback
end
-- Info-Text verstecken
lib.hideTextUI()
-- Wenn immer noch kein Fahrer, ohne Fahrer fortfahren
if not driver or not DoesEntityExist(driver) then
print("^1[TAXI STATIONS DEBUG]^7 Could not create any driver, continuing without driver")
lib.showTextUI('❌ Kein Fahrer verfügbar - Du kannst selbst fahren', {
position = "top-center",
icon = 'exclamation-triangle',
style = {
borderRadius = 10,
backgroundColor = '#FF6B6B',
color = 'white'
}
})
Wait(3000) -- 3 Sekunden anzeigen
lib.hideTextUI()
driver = nil
lib.notify({
@ -256,6 +307,19 @@ RegisterNetEvent('taxi:enterStationVehicle', function(data)
type = 'warning'
})
else
-- Fahrer erfolgreich erstellt
lib.showTextUI('✅ Fahrer bereit - Steige hinten ein!', {
position = "top-center",
icon = 'check-circle',
style = {
borderRadius = 10,
backgroundColor = '#48BB78',
color = 'white'
}
})
Wait(2000) -- 2 Sekunden anzeigen
-- Fahrer konfigurieren
SetEntityAsMissionEntity(driver, true, true)
SetPedFleeAttributes(driver, 0, 0)
@ -380,6 +444,7 @@ RegisterNetEvent('taxi:enterStationVehicle', function(data)
end)
end)
function OpenStationTaxiMenu(stationId, vehicleId, vehicle, driver, pricePerKm)
print("^2[TAXI STATIONS DEBUG]^7 Opening station taxi menu")

View file

@ -84,12 +84,12 @@ Config.TaxiStations = {
},
{
name = "Stadtpark Taxi",
coords = vector4(218.13, -917.98, 29.6, 343.32),
blipCoords = vector3(218.13, -917.98, 29.6),
coords = vector4(204.9, -846.9, 30.5, 254.69),
blipCoords = vector3(204.9, -846.9, 30.5),
vehicles = {
{
model = 'taxi',
coords = vector4(218.13, -917.98, 29.6, 343.32),
coords = vector4(204.9, -846.9, 30.5, 254.69)
pricePerKm = 6
}
}